View/Helper/Navigation/Menu.php
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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_View
- Subpackage
- Helper
- Version
- $Id: Menu.php 25239 2013-01-22 09:45:01Z frosch $
\Zend_View_Helper_Navigation_Menu
Helper for rendering menus from navigation containers
- Parent(s)
- \Zend_View_Helper_Navigation_HelperAbstract < \Zend_View_Helper_HtmlElement < \Zend_View_Helper_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants

EOL
= "\n"
EOL character
Inherited from: \Zend_View_Helper_HtmlElement::EOL\Zend_View_Helper_Navigation_HelperAbstract::EOL- Inherited_from
- \Zend_View_Helper_HtmlElement::EOL
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::EOL
Properties


\Zend_Acl $_acl =
ACL to use when iterating pages
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_acl- Type
- \Zend_Acl
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_acl


string $_activeClass = 'active'
CSS class to use for the active elements
'active'
Details- Type
- string


bool $_addPageClassToLi = false
Adds CSS class from page to li element
false
Details- Type
- bool


string $_closingBracket = null
The tag closing bracket
Inherited from: \Zend_View_Helper_HtmlElement::$$_closingBracket\Zend_View_Helper_Navigation_HelperAbstract::$$_closingBracketnull
Details- Type
- string
- Inherited_from
- \Zend_View_Helper_HtmlElement::$$_closingBracket
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_closingBracket


\Zend_Navigation_Container $_container =
Container to operate on by default
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_container- Type
- \Zend_Navigation_Container
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_container


\Zend_Acl $_defaultAcl =
Default ACL to use when iterating pages if not explicitly set in the instance by calling {@link setAcl()}
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_defaultAcl- Type
- \Zend_Acl
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_defaultAcl


string|\Zend_Acl_Role_Interface $_defaultRole =
Default ACL role to use when iterating pages if not explicitly set in the instance by calling {@link setRole()}
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_defaultRole- Type
- string | \Zend_Acl_Role_Interface
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_defaultRole


bool $_expandSiblingNodesOfActiveBranch = false
Expand all sibling nodes of active branch nodes
false
Details- Type
- bool


bool $_formatOutput = true
Whether HTML/XML output should be formatted
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_formatOutputtrue
Details- Type
- bool
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_formatOutput


string $_indent = ''
''
Details- Type
- string
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_indent


int $_maxDepth =
The maximum depth a page can have to be included when rendering
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_maxDepth- Type
- int
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_maxDepth


int $_minDepth =
The minimum depth a page must have to be included when rendering
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_minDepth- Type
- int
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_minDepth


bool $_onlyActiveBranch = false
Whether only active branch should be rendered
false
Details- Type
- bool


string $_parentClass = 'menu-parent'
CSS class to use for the parent li element
'menu-parent'
Details- Type
- string


string|array $_partial = null
Partial view script to use for rendering menu
null
Details- Type
- string | array


string|null $_prefixForId = null
Prefix for IDs when they are normalized
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_prefixForIdnull
Details- Type
- string | null
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_prefixForId


bool $_renderInvisible = false
Wheter invisible items should be rendered by this helper
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_renderInvisiblefalse
Details- Type
- bool
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_renderInvisible


bool $_renderParentClass = false
Whether parent li elements should be rendered with parent class
false
Details- Type
- bool


bool $_renderParents = true
Whether parents should be rendered when only rendering active branch
true
Details- Type
- bool


string|\Zend_Acl_Role_Interface $_role =
ACL role to use when iterating pages
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_role- Type
- string | \Zend_Acl_Role_Interface
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_role


bool $_skipPrefixForId = false
Skip current prefix for IDs when they are normalized (flag)
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_skipPrefixForIdfalse
Details- Type
- bool
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_skipPrefixForId


\Zend_Translate_Adapter $_translator =
- Type
- \Zend_Translate_Adapter
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_translator


string $_ulClass = 'navigation'
CSS class to use for the ul element
'navigation'
Details- Type
- string


bool $_useAcl = true
Whether ACL should be used for filtering out pages
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_useAcltrue
Details- Type
- bool
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_useAcl


bool $_useTranslator = true
Whether translator should be used for page labels and titles
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::$$_useTranslatortrue
Details- Type
- bool
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$_useTranslator


\Zend_View_Interface $view = null
View object
Inherited from: \Zend_View_Helper_Abstract::$$view\Zend_View_Helper_HtmlElement::$$view\Zend_View_Helper_Navigation_HelperAbstract::$$viewnull
Details- Type
- \Zend_View_Interface
- Inherited_from
- \Zend_View_Helper_Abstract::$$view
- Inherited_from
- \Zend_View_Helper_HtmlElement::$$view
- Inherited_from
- \Zend_View_Helper_Navigation_HelperAbstract::$$view
Methods


__call(string $method, array $arguments = array()) : mixed
Magic overload: Proxy calls to the navigation container
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::__call()Name | Type | Description |
---|---|---|
$method | string | method name in container |
$arguments | array | [optional] arguments to pass |
Type | Description |
---|---|
mixed | returns what the container returns |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if method does not exist in container |


__toString() : string
Magic overload: Proxy to {@link render()}.
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::__toString()This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.
Implements Zend_View_Helper_Navigation_Helper::__toString().
Type | Description |
---|---|
string |


_acceptAcl(\Zend_Navigation_Page $page) : bool
Determines whether a page should be accepted by ACL when iterating
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::_acceptAcl()Rules: - If helper has no ACL, page is accepted - If page has a resource or privilege defined, page is accepted if the ACL allows access to it using the helper's role - If page has no resource or privilege, page is accepted
Name | Type | Description |
---|---|---|
$page | \Zend_Navigation_Page | page to check |
Type | Description |
---|---|
bool | whether page is accepted by ACL |


_getWhitespace(int | string $indent) : string
Retrieve whitespace representation of $indent
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::_getWhitespace()Name | Type | Description |
---|---|---|
$indent | int | string |
Type | Description |
---|---|
string |


_htmlAttribs(array $attribs) : string
Converts an associative array to a string of tag attributes.
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::_htmlAttribs()Overloads Zend_View_Helper_HtmlElement::_htmlAttribs().
Name | Type | Description |
---|---|---|
$attribs | array | an array where each key-value pair is converted to an attribute name and value |
Type | Description |
---|---|
string | an attribute string |


_isStrictDoctype() : boolean
Is doctype strict?
Inherited from: \Zend_View_Helper_HtmlElement::_isStrictDoctype()\Zend_View_Helper_Navigation_HelperAbstract::_isStrictDoctype()Type | Description |
---|---|
boolean |


_isXhtml() : boolean
Is doctype XHTML?
Inherited from: \Zend_View_Helper_HtmlElement::_isXhtml()\Zend_View_Helper_Navigation_HelperAbstract::_isXhtml()Type | Description |
---|---|
boolean |


_normalizeId(string $value) : string
Normalize an ID
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::_normalizeId()Name | Type | Description |
---|---|---|
$value | string | ID |
Type | Description |
---|---|
string | Normalized ID |


_normalizeOptions(array $options = array()) : array
Normalizes given render options
Name | Type | Description |
---|---|---|
$options | array | [optional] options to normalize |
Type | Description |
---|---|
array | normalized options |


_renderDeepestMenu(\Zend_Navigation_Container $container, string $ulClass, string $indent, string $innerIndent, int | null $minDepth, int | null $maxDepth, string | null $ulId, bool $addPageClassToLi, string | null $activeClass, string $parentClass, bool $renderParentClass) : string
Renders the deepest active menu within [$minDepth, $maxDeth], (called from {@link renderMenu()})
Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | container to render |
$ulClass | string | CSS class for first UL |
$indent | string | initial indentation |
$innerIndent | string | inner indentation |
$minDepth | int | null | minimum depth |
$maxDepth | int | null | maximum depth |
$ulId | string | null | unique identifier (id) for first UL |
$addPageClassToLi | bool | adds CSS class from page to li element |
$activeClass | string | null | CSS class for active element |
$parentClass | string | CSS class for parent li's |
$renderParentClass | bool | Render parent class? |
Type | Description |
---|---|
string | rendered menu (HTML) |


_renderMenu(\Zend_Navigation_Container $container, string $ulClass, string $indent, string $innerIndent, int | null $minDepth, int | null $maxDepth, bool $onlyActive, bool $expandSibs, string | null $ulId, bool $addPageClassToLi, string | null $activeClass, string $parentClass, bool $renderParentClass) : string
Renders a normal menu (called from {@link renderMenu()})
Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | container to render |
$ulClass | string | CSS class for first UL |
$indent | string | initial indentation |
$innerIndent | string | inner indentation |
$minDepth | int | null | minimum depth |
$maxDepth | int | null | maximum depth |
$onlyActive | bool | render only active branch? |
$expandSibs | bool | render siblings of active branch nodes? |
$ulId | string | null | unique identifier (id) for first UL |
$addPageClassToLi | bool | adds CSS class from page to li element |
$activeClass | string | null | CSS class for active element |
$parentClass | string | CSS class for parent li's |
$renderParentClass | bool | Render parent class? |
Type | Description |
---|---|
string | rendered menu (HTML) |


accept(\Zend_Navigation_Page $page, bool $recursive = true) : bool
Determines whether a page should be accepted when iterating
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::accept()Rules: - If a page is not visible it is not accepted, unless RenderInvisible has been set to true. - If helper has no ACL, page is accepted - If helper has ACL, but no role, page is not accepted - If helper has ACL and role: - Page is accepted if it has no resource or privilege - Page is accepted if ACL allows page's resource or privilege - If page is accepted by the rules above and $recursive is true, the page will not be accepted if it is the descendant of a non-accepted page.
Name | Type | Description |
---|---|---|
$page | \Zend_Navigation_Page | page to check |
$recursive | bool | [optional] if true, page will not be accepted if it is the descendant of a page that is not accepted. Default is true. |
Type | Description |
---|---|
bool | whether page should be accepted |


addPageClassToLi(bool $flag = true) : \Zend_View_Helper_Navigation_Menu
Adds CSS class from page to li element
Name | Type | Description |
---|---|---|
$flag | bool | [optional] adds CSS class from page to li element |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


direct() : void
Strategy pattern: currently unutilized
Inherited from: \Zend_View_Helper_Abstract::direct()\Zend_View_Helper_HtmlElement::direct()\Zend_View_Helper_Navigation_HelperAbstract::direct()

findActive(\Zend_Navigation_Container $container, int | null | int | null $minDepth = null, $maxDepth = -1) : array
Finds the deepest active page in the given container
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::findActive()Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | container to search |
$minDepth | int | null | int | null | [optional] minimum depth required for page to be valid. Default is to use {@link getMinDepth()}. A null value means no minimum depth required. |
$maxDepth |
Type | Description |
---|---|
array | an associative array with the values 'depth' and 'page', or an empty array if not found |


getAcl() : \Zend_Acl | null
Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()}
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getAcl()Implements Zend_View_Helper_Navigation_Helper::getAcl().
Type | Description |
---|---|
\Zend_Acl | null | ACL object or null |


getActiveClass() : string
Returns CSS class to use for the active elements when rendering
Type | Description |
---|---|
string | CSS class |


getAddPageClassToLi() : bool
Returns a flag indicating whether the CSS class from page to be added to li element
Type | Description |
---|---|
bool |


getClosingBracket() : string
Get the tag closing bracket
Inherited from: \Zend_View_Helper_HtmlElement::getClosingBracket()\Zend_View_Helper_Navigation_HelperAbstract::getClosingBracket()Type | Description |
---|---|
string |


getContainer() : \Zend_Navigation_Container
Returns the navigation container helper operates on by default
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getContainer()Implements Zend_View_Helper_Navigation_Interface::getContainer().
If a helper is not explicitly set in this helper instance by calling setContainer() or by passing it through the helper entry point, this method will look in Zend_Registry for a container by using the key 'Zend_Navigation'.
If no container is set, and nothing is found in Zend_Registry, a new container will be instantiated and stored in the helper.
Type | Description |
---|---|
\Zend_Navigation_Container | navigation container |


getEOL() : string
Returns the EOL character (format output is respected)
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getEOL()Type | Description |
---|---|
string | standard EOL charater or an empty string |
- See
- \global\self::EOL
- See
- \global\getFormatOutput()


getExpandSiblingNodesOfActiveBranch() : bool
Returns a flag indicating whether to expand all sibling nodes of the active branch
By default, this value is false, meaning the entire menu will be be rendered.
Type | Description |
---|---|
bool | whether siblings of nodes in the active branch should be expanded |


getFormatOutput() : bool
Returns whether HTML/XML output should be formatted
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getFormatOutput()Type | Description |
---|---|
bool | whether HTML/XML output should be formatted |


getIndent() : string
Returns indentation (format output is respected)
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getIndent()Type | Description |
---|---|
string | indentation string or an empty string |


getInnerIndent() : string
Returns inner indentation (format output is respected)
Type | Description |
---|---|
string | indentation string or an empty string |
- See
- \global\getFormatOutput()


getMaxDepth() : int | null
Returns maximum depth a page can have to be included when rendering
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getMaxDepth()Type | Description |
---|---|
int | null | maximum depth or null |


getMinDepth() : int | null
Returns minimum depth a page must have to be included when rendering
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getMinDepth()Type | Description |
---|---|
int | null | minimum depth or null |


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.
Type | Description |
---|---|
bool | whether only active branch should be rendered |


getParentClass() : string
Returns CSS class to use for the parent lie elements when rendering
Type | Description |
---|---|
string | CSS class |


getPartial() : string | array | null
Returns partial view script to use for rendering menu
Type | Description |
---|---|
string | array | null |


getPrefixForId() : string
Returns prefix for IDs when they are normalized
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getPrefixForId()Type | Description |
---|---|
string | Prefix for |


getRenderInvisible() : bool
Return renderInvisible flag
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getRenderInvisible()Type | Description |
---|---|
bool |


getRenderParentClass() : bool
Returns flag indicating whether parent class should be rendered to the li element
Type | Description |
---|---|
bool | whether parent class should be rendered |


getRenderParents() : bool
Returns flag indicating whether parents should be rendered when rendering only the active branch
By default, this value is true.
Type | Description |
---|---|
bool | whether parents should be rendered |


getRole() : string | \Zend_Acl_Role_Interface | null
Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()}
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getRole()Implements Zend_View_Helper_Navigation_Helper::getRole().
Type | Description |
---|---|
string | \Zend_Acl_Role_Interface | null | role or null |


getTranslator() : \Zend_Translate_Adapter | null
Returns translator used in helper
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getTranslator()Type | Description |
---|---|
\Zend_Translate_Adapter | null | translator or null |


getUlClass() : string
Returns CSS class to use for the first 'ul' element when rendering
Type | Description |
---|---|
string | CSS class |


getUlId() : string | null
Returns unique identifier (id) to use for the first 'ul' element when rendering
Type | Description |
---|---|
string | null | Unique identifier (id); Default is 'null' |


getUseAcl() : bool
Returns whether ACL should be used
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getUseAcl()Implements Zend_View_Helper_Navigation_Helper::getUseAcl().
Type | Description |
---|---|
bool | whether ACL should be used |


getUseTranslator() : bool
Returns whether translator should be used
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::getUseTranslator()Type | Description |
---|---|
bool | whether translator should be used |


hasAcl() : bool
Checks if the helper has an ACL instance
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::hasAcl()Implements Zend_View_Helper_Navigation_Helper::hasAcl().
Type | Description |
---|---|
bool | whether the helper has a an ACL instance or not |


hasContainer() : bool
Checks if the helper has a container
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::hasContainer()Type | Description |
---|---|
bool | whether the helper has a container or not |


hasRole() : bool
Checks if the helper has an ACL role
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::hasRole()Implements Zend_View_Helper_Navigation_Helper::hasRole().
Type | Description |
---|---|
bool | whether the helper has a an ACL role or not |


hasTranslator() : bool
Checks if the helper has a translator
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::hasTranslator()Type | Description |
---|---|
bool | whether the helper has a translator or not |


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
Name | Type | Description |
---|---|---|
$page | \Zend_Navigation_Page | page to generate HTML for |
Type | Description |
---|---|
string | HTML string for the given page |


menu(\Zend_Navigation_Container $container = null) : \Zend_View_Helper_Navigation_Menu
View helper entry point: Retrieves helper and optionally sets container to operate on
Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | [optional] container to operate on |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


render(\Zend_Navigation_Container $container = null) : string
Renders menu
Implements 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.
Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | [optional] container to render. Default is to render the container registered in the helper. |
Type | Description |
---|---|
string | helper output |
Exception | Description |
---|---|
\Zend_View_Exception | if unable to render |
- See
- \global\renderPartial()
- See
- \global\renderMenu()


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:
Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | [optional] container to create menu from. Default is to use the container retrieved from {@link getContainer()}. |
$options | array | [optional] options for controlling rendering |
Type | Description |
---|---|
string | rendered menu |


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);
.
Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | [optional] container to pass to view script. Default is to use the container registered in the helper. |
$partial | string | array | [optional] partial view script to use. Default is to use the partial registered in the helper. If an array is given, it is expected to contain two values; the partial view script to use, and the module where the script can be found. |
Type | Description |
---|---|
string | helper output |
Exception | Description |
---|---|
\Zend_View_Exception | When no partial script is set |


renderSubMenu(\Zend_Navigation_Container $container = null, string | null $ulClass = null, string | int $indent = null, string | null $ulId = null, bool $addPageClassToLi = false, string | int $innerIndent = 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
));
Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | [optional] container to render. Default is to render the container registered in the helper. |
$ulClass | string | null | [optional] CSS class to use for UL element. Default is to use the value from {@link getUlClass()}. |
$indent | string | int | [optional] indentation as a string or number of spaces. Default is to use the value retrieved from {@link getIndent()}. |
$ulId | string | null | [optional] Unique identifier (id) use for UL element |
$addPageClassToLi | bool | adds CSS class from page to li element |
$innerIndent | string | int | [optional] inner indentation as a string or number of spaces. Default is to use the {@link getInnerIndent()}. |
Type | Description |
---|---|
string | rendered content |


setAcl(\Zend_Acl $acl = null) : \Zend_View_Helper_Navigation_HelperAbstract
Sets ACL to use when iterating pages
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setAcl()Implements Zend_View_Helper_Navigation_Helper::setAcl().
Name | Type | Description |
---|---|---|
$acl | \Zend_Acl | [optional] ACL object. Default is null. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setActiveClass(string $activeClass) : \Zend_View_Helper_Navigation_Menu
Sets CSS class to use for the active elements when rendering
Name | Type | Description |
---|---|---|
$activeClass | string | CSS class to set |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setContainer(\Zend_Navigation_Container $container = null) : \Zend_View_Helper_Navigation_HelperAbstract
Sets navigation container the helper operates on by default
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setContainer()Name | Type | Description |
---|---|---|
$container | \Zend_Navigation_Container | [optional] container to operate on. Default is null, meaning container will be reset. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setDefaultAcl(\Zend_Acl $acl = null) : void
Sets default ACL to use if another ACL is not explicitly set
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl()Name | Type | Description |
---|---|---|
$acl | \Zend_Acl | [optional] ACL object. Default is null, which sets no ACL object. |


setDefaultRole(\midex $role = null) : void
Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()}
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole()Name | Type | Description |
---|---|---|
$role | \midex | [optional] role to set. Expects null, string, or an instance of {@link Zend_Acl_Role_Interface}. Default is null, which sets no default role. |
Exception | Description |
---|---|
\Zend_View_Exception | if role is invalid |


setExpandSiblingNodesOfActiveBranch(bool $flag = true) : \Zend_View_Helper_Navigation_Menu
Sets a flag indicating whether to expand all sibling nodes of the active branch
Name | Type | Description |
---|---|---|
$flag | bool | [optional] expand all siblings of nodes in the active branch. Default is true. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setFormatOutput(bool $formatOutput = true) : \Zend_View_Helper_Navigation_Sitemap
Sets whether HTML/XML output should be formatted
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setFormatOutput()Name | Type | Description |
---|---|---|
$formatOutput | bool | [optional] whether output should be formatted. Default is true. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Sitemap | fluent interface, returns self |


setIndent(string | int $indent) : \Zend_View_Helper_Navigation_HelperAbstract
Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setIndent()Name | Type | Description |
---|---|---|
$indent | string | int | indentation string or number of spaces |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setInnerIndent(string | int $indent) : \Zend_View_Helper_Navigation_HelperAbstract
Set the inner indentation string for using in {@link render()}, optionally a number of spaces to indent with
Name | Type | Description |
---|---|---|
$indent | string | int | indentation string or number of spaces |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setMaxDepth(int $maxDepth = null) : \Zend_View_Helper_Navigation_HelperAbstract
Sets the maximum depth a page can have to be included when rendering
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setMaxDepth()Name | Type | Description |
---|---|---|
$maxDepth | int | [optional] maximum depth. Default is null, which sets no maximum depth. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setMinDepth(int $minDepth = null) : \Zend_View_Helper_Navigation_HelperAbstract
Sets the minimum depth a page must have to be included when rendering
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setMinDepth()Name | Type | Description |
---|---|---|
$minDepth | int | [optional] minimum depth. Default is null, which sets no minimum depth. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setOnlyActiveBranch(bool $flag = true) : \Zend_View_Helper_Navigation_Menu
Sets a flag indicating whether only active branch should be rendered
Name | Type | Description |
---|---|---|
$flag | bool | [optional] render only active branch. Default is true. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setParentClass(string $parentClass) : \Zend_View_Helper_Navigation_Menu
Sets CSS class to use for the parent li elements when rendering
Name | Type | Description |
---|---|---|
$parentClass | string | CSS class to set to parents |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setPartial(string | array $partial) : \Zend_View_Helper_Navigation_Menu
Sets which partial view script to use for rendering menu
Name | Type | Description |
---|---|---|
$partial | string | array | partial view script or null. If an array is given, it is expected to contain two values; the partial view script to use, and the module where the script can be found. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setPrefixForId(string $prefix) : \Zend_View_Helper_Navigation_HelperAbstract
Sets prefix for IDs when they are normalized
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setPrefixForId()Name | Type | Description |
---|---|---|
$prefix | string | Prefix for IDs |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setRenderInvisible(bool $renderInvisible = true) : \Zend_View_Helper_Navigation_HelperAbstract
Render invisible items?
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setRenderInvisible()Name | Type | Description |
---|---|---|
$renderInvisible | bool | [optional] boolean flag |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface returns self |


setRenderParentClass(bool $flag = true) : \Zend_View_Helper_Navigation_Menu
Enables/disables rendering of parent class to the li element
Name | Type | Description |
---|---|---|
$flag | bool | [optional] render with parent class. Default is true. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setRenderParents(bool $flag = true) : \Zend_View_Helper_Navigation_Menu
Enables/disables rendering of parents when only rendering active branch
See setOnlyActiveBranch() for more information.
Name | Type | Description |
---|---|---|
$flag | bool | [optional] render parents when rendering active branch. Default is true. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setRole(mixed $role = null) : \Zend_View_Helper_Navigation_HelperAbstract
Sets ACL role(s) to use when iterating pages
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setRole()Implements Zend_View_Helper_Navigation_Helper::setRole().
Name | Type | Description |
---|---|---|
$role | mixed | [optional] role to set. Expects a string, an instance of type {@link Zend_Acl_Role_Interface}, or null. Default is null, which will set no role. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_View_Exception | if $role is invalid |


setTranslator(mixed $translator = null) : \Zend_View_Helper_Navigation_HelperAbstract
Sets translator to use in helper
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setTranslator()Name | Type | Description |
---|---|---|
$translator | mixed | [optional] translator. Expects an object of type {@link Zend_Translate_Adapter} or {@link Zend_Translate}, or null. Default is null, which sets no translator. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setUlClass(string $ulClass) : \Zend_View_Helper_Navigation_Menu
Sets CSS class to use for the first 'ul' element when rendering
Name | Type | Description |
---|---|---|
$ulClass | string | CSS class to set |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setUlId(string | null $ulId) : \Zend_View_Helper_Navigation_Menu
Sets unique identifier (id) to use for the first 'ul' element when rendering
Name | Type | Description |
---|---|---|
$ulId | string | null | Unique identifier (id) to set |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_Menu | fluent interface, returns self |


setUseAcl(bool $useAcl = true) : \Zend_View_Helper_Navigation_HelperAbstract
Sets whether ACL should be used
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setUseAcl()Implements Zend_View_Helper_Navigation_Helper::setUseAcl().
Name | Type | Description |
---|---|---|
$useAcl | bool | [optional] whether ACL should be used. Default is true. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setUseTranslator(bool $useTranslator = true) : \Zend_View_Helper_Navigation_HelperAbstract
Sets whether translator should be used
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::setUseTranslator()Name | Type | Description |
---|---|---|
$useTranslator | bool | [optional] whether translator should be used. Default is true. |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |


setView(\Zend_View_Interface $view) : \Zend_View_Helper_Abstract
Set the View object
Inherited from: \Zend_View_Helper_Abstract::setView()\Zend_View_Helper_HtmlElement::setView()\Zend_View_Helper_Navigation_HelperAbstract::setView()Name | Type | Description |
---|---|---|
$view | \Zend_View_Interface |
Type | Description |
---|---|
\Zend_View_Helper_Abstract |


skipPrefixForId(bool $flag = true) : \Zend_View_Helper_Navigation_HelperAbstract
Skip the current prefix for IDs when they are normalized
Inherited from: \Zend_View_Helper_Navigation_HelperAbstract::skipPrefixForId()Name | Type | Description |
---|---|---|
$flag | bool |
Type | Description |
---|---|
\Zend_View_Helper_Navigation_HelperAbstract | fluent interface, returns self |