Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Helper for rendering menus from navigation containers
bool $_onlyActiveBranch = 'false'
Whether only active branch should be rendered
string|array $_partial = 'null'
Partial view script to use for rendering menu
bool $_renderParents = 'true'
Whether parents should be rendered when only rendering active branch
string $_ulClass = 'navigation'
CSS class to use for the ul element
_normalizeOptions(
array $options
=
array
)
:
array
Normalizes given render options
_renderDeepestMenu(
Zend_Navigation_Container $container, string $ulClass, string $indent, int|null $minDepth, int|null $maxDepth
)
:
string
Renders the deepest active menu within [$minDepth, $maxDeth], (called from {@link renderMenu()})
_renderMenu(
Zend_Navigation_Container $container, string $ulClass, string $indent, int|null $minDepth, int|null $maxDepth, bool $onlyActive
)
:
string
Renders a normal menu (called from {@link renderMenu()})
getOnlyActiveBranch(
)
:
bool
Returns a flag indicating whether only active branch should be rendered
By default, this value is false, meaning the entire menu will be be rendered.
getPartial(
)
:
string|array|null
Returns partial view script to use for rendering menu
getRenderParents(
)
:
bool
Returns flag indicating whether parents should be rendered when rendering only the active branch
By default, this value is true.
getUlClass(
)
:
string
Returns CSS class to use for the first 'ul' element when rendering
htmlify(
Zend_Navigation_Page $page
)
:
string
Returns an HTML string containing an 'a' element for the given page if the page's href is not empty, and a 'span' element if it is empty
Overrides {@link Zend_View_Helper_Navigation_Abstract::htmlify()}.
menu(
Zend_Navigation_Container $container
=
null
)
:
Zend_View_Helper_Navigation_Menu
View helper entry point: Retrieves helper and optionally sets container to operate on
render(
Zend_Navigation_Container $container
=
null
)
:
string
Renders menu
Implements {@link Zend_View_Helper_Navigation_Helper::render()}.
If a partial view is registered in the helper, the menu will be rendered using the given partial script. If no partial is registered, the menu will be rendered as an 'ul' element by the helper's internal method.
renderMenu(
Zend_Navigation_Container $container
=
null, array $options
=
array
)
:
string
Renders helper
Renders a HTML 'ul' for the given $container. If $container is not given, the container registered in the helper will be used.
Available $options:
renderPartial(
Zend_Navigation_Container $container
=
null, string|array $partial
=
null
)
:
string
Renders the given $container by invoking the partial view helper
The container will simply be passed on as a model to the view script
as-is, and will be available in the partial script as 'container', e.g.
echo 'Number of pages: ', count($this->container);
.
renderSubMenu(
Zend_Navigation_Container $container
=
null, string $ulClass
=
null, string|int $indent
=
null
)
:
string
Renders the inner-most sub menu for the active page in the $container
This is a convenience method which is equivalent to the following call:
renderMenu($container, array(
'indent' => $indent,
'ulClass' => $ulClass,
'minDepth' => null,
'maxDepth' => null,
'onlyActiveBranch' => true,
'renderParents' => false
));
setOnlyActiveBranch(
bool $flag
=
true
)
:
Zend_View_Helper_Navigation_Menu
Sets a flag indicating whether only active branch should be rendered
setPartial(
string|array $partial
)
:
Zend_View_Helper_Navigation_Menu
Sets which partial view script to use for rendering menu
setRenderParents(
bool $flag
=
true
)
:
Zend_View_Helper_Navigation_Menu
Enables/disables rendering of parents when only rendering active branch
See {@link setOnlyActiveBranch()} for more information.
setUlClass(
string $ulClass
)
:
Zend_View_Helper_Navigation_Menu
Sets CSS class to use for the first 'ul' element when rendering