Skip to content

Commit

Permalink
nav: Give item renderer a chance to set the CSS class of the outer li…
Browse files Browse the repository at this point in the history
… element

refs #5543
  • Loading branch information
lippserd committed Oct 26, 2015
1 parent 4593c78 commit 8341415
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Expand Up @@ -352,8 +352,9 @@ public function render()
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();
}
}
Expand Down
Expand Up @@ -162,14 +162,15 @@ public function render()
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();
Expand Down

0 comments on commit 8341415

Please sign in to comment.