Navigation: Support empty labels for creating containers

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-27 15:42:26 +02:00
parent d8f45fc9b1
commit 63e0549618
2 changed files with 5 additions and 3 deletions

View File

@ -436,7 +436,7 @@ class NavigationItem implements IteratorAggregate
*/ */
public function getLabel() public function getLabel()
{ {
return $this->label ?: $this->getName(); return $this->label !== null ? $this->label : $this->getName();
} }
/** /**

View File

@ -56,7 +56,7 @@ class NavigationItemRenderer
*/ */
public function init() public function init()
{ {
} }
/** /**
@ -164,13 +164,15 @@ class NavigationItemRenderer
$this->renderTargetAttribute(), $this->renderTargetAttribute(),
$label $label
); );
} else { } elseif ($label) {
$content = sprintf( $content = sprintf(
'<%1$s%2$s>%3$s</%1$s>', '<%1$s%2$s>%3$s</%1$s>',
$item::LINK_ALTERNATIVE, $item::LINK_ALTERNATIVE,
$this->view()->propertiesToString($item->getAttributes()), $this->view()->propertiesToString($item->getAttributes()),
$label $label
); );
} else {
$content = '';
} }
return $content; return $content;