Issues

ZF-9277: extend navigation menu for setSeparator() method

Description

For now it is only possible to use the method "setSeparator()" with breadcrumbs. If somebody wants to use navigaton menu with his own style and the method "setPartial()" is used it is very well to have a possibility to set a separator and use it in the view script.


$this->navigation()->menu($container)->setSeparator(">>")->setPartial("any_view_script.phtml")->render();

Comments

Hi Hans, a separator is a good idea. But we need two: one for the whole element and one for list items.


if ($depth > $prevDepth) {
    // ...
    $html .= $myIndent . '
' . self::EOL; } else if ($prevDepth > $depth) { // ... for ($i = $prevDepth; $i > $depth; $i--) { $ind = $indent . str_repeat(' ', $i); $html .= $ind . ' ' . self::EOL; $html .= $ind . '' . self::EOL; } // close previous li tag $html .= $myIndent . ' ' . self::EOL; } else { // close previous li tag $html .= $myIndent . ' ' . self::EOL; }

$separator     = $this->getSeparator();
$listSeparator = $this->getListSeparator();

if ($depth > $prevDepth) {
    // ...
    $html .= $myIndent . '
' . $listSeparator; } else if ($prevDepth > $depth) { // ... for ($i = $prevDepth; $i > $depth; $i--) { $ind = $indent . str_repeat(' ', $i); $html .= $ind . ' ' . $listSeparator; $html .= $ind . '' . $separator; } // close previous li tag $html .= $myIndent . ' ' . $listSeparator; } else { // close previous li tag $html .= $myIndent . ' ' . $listSeparator; }

These would be also available in your partial scripts.

The separator is an output as "real" content, which the user can see. The same use as in the breadcrumb helper. For the HTML formatting we should use an option "formatOutput" (look at the sitemap helper).

I do not see why we need a separator for a menu! I think we can close this issue. For formatted output, I'll work on: ZF-8874

Feel free to reopen the issue if I have missed something.