Commit 19262735 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Aide de vue MenuSecondaire : ajout méthode doNotRender() permettant de...

Aide de vue MenuSecondaire : ajout méthode doNotRender() permettant de désactiver le rendu du menu secondaire.
parent 3c19c299
Pipeline #4100 passed with stage
in 20 seconds
<?php
namespace UnicaenApp\View\Helper\Navigation;
use RecursiveIteratorIterator;
use Zend\Navigation\AbstractContainer;
/**
* Dessine le menu secondaire de l'application (vertical).
......@@ -35,19 +35,32 @@ class MenuSecondaire extends AbstractMenu
protected $ulClass = 'nav nav-pills nav-stacked menu-secondaire';
/**
* Renders helper
*
* Renders a HTML 'ul' for the given $container. If $container is not given,
* the container registered in the helper will be used.
*
* Available $options:
*
*
* @param AbstractContainer $container [optional] container to create menu from.
* Default is to use the container retrieved
* from {@link getContainer()}.
* @param array $options [optional] options for controlling rendering
* @return string
* @var bool
*/
protected $doNotRender = false;
/**
* Désactive le rendu du menu secondaire.
*/
public function doNotRender()
{
$this->doNotRender = true;
}
/**
* {@inheritdoc}
*/
public function render($container = null)
{
if ($this->doNotRender) {
return '';
}
return parent::render($container);
}
/**
* {@inheritdoc}
*/
public function renderMenu($container = null, array $options = array())
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment