nav: Give item renderer a chance to set the CSS class of the outer li element

refs #5543
This commit is contained in:
Eric Lippmann 2015-10-26 12:32:49 +01:00
parent 4593c78d16
commit 8341415d28
2 changed files with 7 additions and 5 deletions

View File

@ -352,8 +352,9 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
foreach ($this as $item) {
/** @var NavigationItem $item */
if ($item->shouldRender()) {
$content = $item->render();
$this->content[] = $this->beginItemMarkup($item);
$this->content[] = $item->render();
$this->content[] = $content;
$this->content[] = $this->endItemMarkup();
}
}

View File

@ -162,14 +162,15 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
foreach ($this as $item) {
/** @var NavigationItem $item */
if ($item->shouldRender()) {
$this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
if ($this->getUseStandardItemRenderer()) {
$renderer = new NavigationItemRenderer();
$this->content[] = $renderer->render($item);
$content = $renderer->render($item);
} else {
$this->content[] = $item->render();
$content = $item->render();
}
$this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
$this->content[] = $content;
if (! $item->hasChildren()) {
$this->content[] = $this->getInnerIterator()->endItemMarkup();