This chapter documents primarily backwards compatibility breaks made in
Zend_View_Helper_Navigation, and should serve to aid
in migration from previous versions.
Prior to the 1.9 release, the menu helper
Zend_View_Helper_Navigation_Menu) did not
render sub menus correctly. When the
was TRUE and the option
FALSE, nothing would be rendered if the deepest active
page was at a depth lower than the
In simpler words; if
minDepth was set to
and the active page was at one of the first level pages, nothing
would be rendered, as the following example shows.
Consider the following container setup:
'Home', 'uri' => '#' ), array( 'label' => 'Products', 'uri' => '#', 'active' => true, 'pages' => array( array( 'label' => 'Server', 'uri' => '#' ), array( 'label' => 'Studio', 'uri' => '#' ) ) ), array( 'label' => 'Solutions', 'uri' => '#' ) ));
The following code is used in a view script:
navigation()->menu()->renderMenu($container, array( 'minDepth' => 1, 'onlyActiveBranch' => true, 'renderParents' => false )); ?>
Before release 1.9, the code snippet above would output nothing.
Since release 1.9, the _renderDeepestMenu() method in
Zend_View_Helper_Navigation_Menu will accept
active pages at one level below
minDepth, as long as
the page has children.
The same code snippet will now output the following: