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:
parent
425c6da47f
commit
a9461ada54
|
@ -340,7 +340,7 @@ class NavigationItem implements IteratorAggregate
|
||||||
*/
|
*/
|
||||||
public function hasChildren()
|
public function hasChildren()
|
||||||
{
|
{
|
||||||
return !$this->getChildren()->isEmpty();
|
return ! $this->getChildren()->isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -791,7 +791,7 @@ class NavigationItem implements IteratorAggregate
|
||||||
public function getRender()
|
public function getRender()
|
||||||
{
|
{
|
||||||
if ($this->render === null) {
|
if ($this->render === null) {
|
||||||
return true;
|
return $this->getUrl() !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render;
|
return $this->render;
|
||||||
|
|
Loading…
Reference in New Issue