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()
{
return $this->label ?: $this->getName();
return $this->label !== null ? $this->label : $this->getName();
}
/**

View File

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