Only render a menu item when it's not empty

A menu item is not empty when it either has children or a defined URL.
This commit is contained in:
Eric Lippmann 2016-11-28 14:56:17 +01:00
parent 425c6da47f
commit a9461ada54
1 changed files with 2 additions and 2 deletions

View File

@ -340,7 +340,7 @@ class NavigationItem implements IteratorAggregate
*/
public function hasChildren()
{
return !$this->getChildren()->isEmpty();
return ! $this->getChildren()->isEmpty();
}
/**
@ -791,7 +791,7 @@ class NavigationItem implements IteratorAggregate
public function getRender()
{
if ($this->render === null) {
return true;
return $this->getUrl() !== null;
}
return $this->render;