Proxy helper for retrieving navigational helpers and forwarding calls

category Zend
package Zend_View
subpackage Helper

 Methods

Magic overload: Proxy to other navigation helpers or the container

__call(string $method, array $arguments) : mixed

Examples of usage from a view script or layout:

// proxy to Menu helper and render container:
echo $this->navigation()->menu();

// proxy to Breadcrumbs helper and set indentation:
$this->navigation()->breadcrumbs()->setIndent(8);

// proxy to container and find all pages with 'blog' route:
$blogPages = $this->navigation()->findAllByRoute('blog');

Parameters

$method

string

helper name or method name in container

$arguments

array

[optional] arguments to pass

Exceptions

\Zend\View\Exception\ExceptionInterface if proxying to a helper, and the helper is not an instance of the interface specified in {@link findHelper()}
\Zend\Navigation\Exception\ExceptionInterface if method does not exist in container

Returns

mixedreturns what the proxied call returns

Helper entry point

__invoke(string | \Zend\Navigation\AbstractContainer $container) : \Zend\View\Helper\Navigation

Parameters

$container

string\Zend\Navigation\AbstractContainer

container to operate on

Returns

Magic overload: Proxy to {@link render()}.

__toString() : string
Inherited

This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.

Implements HelperInterface::__toString().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::__toString()

Returns

string

Determines whether a page should be accepted when iterating

accept(\Zend\Navigation\Page\AbstractPage $page, bool $recursive) : bool
Inherited

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.

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::accept()

Parameters

$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.

Returns

boolwhether page should be accepted

Finds the deepest active page in the given container

findActive(\Zend\Navigation\AbstractContainer $container, int | null $minDepth, int | null $maxDepth) : array
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::findActive()

Parameters

$container

\Zend\Navigation\AbstractContainer

container to search

$minDepth

intnull

[optional] minimum depth required for page to be valid. Default is to use {@link getMinDepth()}. A null value means no minimum depth required.

$maxDepth

intnull

[optional] maximum depth a page can have to be valid. Default is to use {@link getMaxDepth()}. A null value means no maximum depth required.

Returns

arrayan associative array with the values 'depth' and 'page', or an empty array if not found

Returns the helper matching $proxy

findHelper(string $proxy, bool $strict) : \Zend\View\Helper\Navigation\HelperInterface

The helper must implement the interface Zend\View\Helper\Navigation\Helper.

Parameters

$proxy

string

helper name

$strict

bool

[optional] whether exceptions should be thrown if something goes wrong. Default is true.

Exceptions

\Zend\View\Exception\RuntimeException if $strict is true and helper cannot be found

Returns

Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()}

getAcl() : \Zend\Permissions\Acl\Acl | null
Inherited

Implements HelperInterface::getAcl().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getAcl()

Returns

\Zend\Permissions\Acl\AclnullACL object or null

Get the tag closing bracket

getClosingBracket() : string
Inherited

inherited_from \Zend\View\Helper\AbstractHtmlElement::getClosingBracket()
inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getClosingBracket()

Returns

string

Returns the navigation container helper operates on by default

getContainer() : \Zend\Navigation\AbstractContainer
Inherited

Implements HelperInterface::getContainer().

If no container is set, a new container will be instantiated and stored in the helper.

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getContainer()

Returns

Returns the default proxy to use in {@link render()}

getDefaultProxy() : string

Returns

stringthe default proxy to use in {@link render()}

Returns indentation

getIndent() : string
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getIndent()

Returns

string

Returns whether ACL should be injected when proxying

getInjectAcl() : bool

Returns

boolwhether ACL should be injected when proxying

Returns whether container should be injected when proxying

getInjectContainer() : bool

Returns

boolwhether container should be injected when proxying

Returns whether translator should be injected when proxying

getInjectTranslator() : bool

Returns

boolwhether translator should be injected when proxying

Returns maximum depth a page can have to be included when rendering

getMaxDepth() : int | null
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getMaxDepth()

Returns

intnullmaximum depth or null

Returns minimum depth a page must have to be included when rendering

getMinDepth() : int | null
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getMinDepth()

Returns

intnullminimum depth or null

Retrieve plugin loader for navigation helpers

getPluginManager() : \Zend\View\Helper\Navigation\PluginManager

Lazy-loads an instance of Navigation\HelperLoader if none currently registered.

Returns

Return renderInvisible flag

getRenderInvisible() : bool
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getRenderInvisible()

Returns

bool

Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()}

getRole() : string | \Zend\Permissions\Acl\Role\RoleInterface | null
Inherited

Implements HelperInterface::getRole().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getRole()

Returns

Get the service locator.

getServiceLocator() : \Zend\ServiceManager\ServiceLocatorInterface
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getServiceLocator()

Returns

Returns translator used in helper

getTranslator() : \Zend\I18n\Translator\Translator | null
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getTranslator()

Returns

Return the translation text domain

getTranslatorTextDomain() : string
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getTranslatorTextDomain()

Returns

string

Returns whether ACL should be used

getUseAcl() : bool
Inherited

Implements HelperInterface::getUseAcl().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getUseAcl()

Returns

boolwhether ACL should be used

Get the view object

getView() : null | \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::getView()
inherited_from \Zend\View\Helper\AbstractHtmlElement::getView()
inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getView()

Returns

Checks if the helper has an ACL instance

hasAcl() : bool
Inherited

Implements HelperInterface::hasAcl().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::hasAcl()

Returns

boolwhether the helper has a an ACL instance or not

Checks if the helper has a container

hasContainer() : bool
Inherited

Implements HelperInterface::hasContainer().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::hasContainer()

Returns

boolwhether the helper has a container or not

Checks if the helper has an ACL role

hasRole() : bool
Inherited

Implements HelperInterface::hasRole().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::hasRole()

Returns

boolwhether the helper has a an ACL role or not

Checks if the helper has a translator

hasTranslator() : bool
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::hasTranslator()

Returns

bool

Returns an HTML string containing an 'a' element for the given page

htmlify(\Zend\Navigation\Page\AbstractPage $page) : string
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::htmlify()

Parameters

$page

\Zend\Navigation\Page\AbstractPage

page to generate HTML for

Returns

stringHTML string for the given page

Returns whether translator is enabled and should be used

isTranslatorEnabled() : bool
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::isTranslatorEnabled()

Returns

bool

Renders helper

render(\Zend\Navigation\AbstractContainer $container) : string

Parameters

$container

\Zend\Navigation\AbstractContainer

[optional] container to render. Default is to render the container registered in the helper.

Exceptions

\Zend\View\Exception\RuntimeException if helper cannot be found

Returns

stringhelper output

Sets ACL to use when iterating pages

setAcl(\Zend\Permissions\Acl\Acl $acl) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

Implements HelperInterface::setAcl().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setAcl()

Parameters

$acl

\Zend\Permissions\Acl\Acl

[optional] ACL object. Default is null.

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface, returns self

Sets navigation container the helper operates on by default

setContainer(string | \Zend\Navigation\AbstractContainer $container) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

Implements HelperInterface::setContainer().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setContainer()

Parameters

$container

string\Zend\Navigation\AbstractContainer

[optional] container to operate on. Default is null, meaning container will be reset.

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface, returns self

Sets default ACL to use if another ACL is not explicitly set

setDefaultAcl(\Zend\Permissions\Acl\Acl $acl) : void
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setDefaultAcl()

Parameters

$acl

\Zend\Permissions\Acl\Acl

[optional] ACL object. Default is null, which sets no ACL object.

Sets the default proxy to use in {@link render()}

setDefaultProxy(string $proxy) : \Zend\View\Helper\Navigation

Parameters

$proxy

string

default proxy

Returns

\Zend\View\Helper\Navigationfluent interface, returns self

Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()}

setDefaultRole(mixed $role) : void
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setDefaultRole()

Parameters

$role

mixed

[optional] role to set. Expects null, string, or an instance of {@link Acl\Role\RoleInterface}. Default is null, which sets no default role.

Exceptions

\Zend\View\Exception\InvalidArgumentException if role is invalid

Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with

setIndent(string | int $indent) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setIndent()

Parameters

$indent

stringint

indentation string or number of spaces

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface, returns self

Sets whether ACL should be injected when proxying

setInjectAcl(bool $injectAcl) : \Zend\View\Helper\Navigation

Parameters

$injectAcl

bool

[optional] whether ACL should be injected when proxying. Default is true.

Returns

\Zend\View\Helper\Navigationfluent interface, returns self

Sets whether container should be injected when proxying

setInjectContainer(bool $injectContainer) : \Zend\View\Helper\Navigation

Parameters

$injectContainer

bool

[optional] whether container should be injected when proxying. Default is true.

Returns

\Zend\View\Helper\Navigationfluent interface, returns self

Sets whether translator should be injected when proxying

setInjectTranslator(bool $injectTranslator) : \Zend\View\Helper\Navigation

Parameters

$injectTranslator

bool

[optional] whether translator should be injected when proxying. Default is true.

Returns

\Zend\View\Helper\Navigationfluent interface, returns self

Sets the maximum depth a page can have to be included when rendering

setMaxDepth(int $maxDepth) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setMaxDepth()

Parameters

$maxDepth

int

[optional] maximum depth. Default is null, which sets no maximum depth.

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface, returns self

Sets the minimum depth a page must have to be included when rendering

setMinDepth(int $minDepth) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setMinDepth()

Parameters

$minDepth

int

[optional] minimum depth. Default is null, which sets no minimum depth.

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface, returns self

Set manager for retrieving navigation helpers

setPluginManager(\Zend\View\Helper\Navigation\PluginManager $plugins) : \Zend\View\Helper\Navigation

Render invisible items?

setRenderInvisible(bool $renderInvisible) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setRenderInvisible()

Parameters

$renderInvisible

bool

[optional] boolean flag

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface returns self

Sets ACL role(s) to use when iterating pages

setRole(mixed $role) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

Implements HelperInterface::setRole().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setRole()

Parameters

$role

mixed

[optional] role to set. Expects a string, an instance of type {@link Acl\Role\RoleInterface}, or null. Default is null, which will set no role.

Exceptions

\Zend\View\Exception\InvalidArgumentException if $role is invalid

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface, returns self

Set the service locator.

setServiceLocator(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setServiceLocator()

Parameters

Returns

Sets translator to use in helper

setTranslator(\Zend\I18n\Translator\Translator $translator, string $textDomain) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setTranslator()

Parameters

$translator

\Zend\I18n\Translator\Translator

[optional] translator. Default is null, which sets no translator.

$textDomain

string

[optional] text domain Default is null, which skips setTranslatorTextDomain

Returns

Sets whether translator is enabled and should be used

setTranslatorEnabled(bool $enabled) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setTranslatorEnabled()

Parameters

$enabled

bool

[optional] whether translator should be used. Default is true.

Returns

Set translation text domain

setTranslatorTextDomain(string $textDomain) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setTranslatorTextDomain()

Parameters

$textDomain

string

Returns

Sets whether ACL should be used

setUseAcl(bool $useAcl) : \Zend\View\Helper\Navigation\AbstractHelper
Inherited

Implements HelperInterface::setUseAcl().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setUseAcl()

Parameters

$useAcl

bool

[optional] whether ACL should be used. Default is true.

Returns

\Zend\View\Helper\Navigation\AbstractHelperfluent interface, returns self

Set the View object

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::setView()
inherited_from \Zend\View\Helper\AbstractHtmlElement::setView()
inherited_from \Zend\View\Helper\Navigation\AbstractHelper::setView()

Parameters

Returns

Determines whether a page should be accepted by ACL when iterating

acceptAcl(\Zend\Navigation\Page\AbstractPage $page) : bool
Inherited

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

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::acceptAcl()

Parameters

Returns

boolwhether page is accepted by ACL

Retrieve whitespace representation of $indent

getWhitespace(int | string $indent) : string
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::getWhitespace()

Parameters

$indent

intstring

Returns

string

Converts an associative array to a string of tag attributes.

htmlAttribs(array $attribs) : string
Inherited

Overloads View\Helper\AbstractHtmlElement::htmlAttribs().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::htmlAttribs()

Parameters

$attribs

array

an array where each key-value pair is converted to an attribute name and value

Returns

stringan attribute string

Injects container, ACL, and translator to the given $helper if this helper is configured to do so

inject(\Zend\View\Helper\Navigation\HelperInterface $helper) : void

Parameters

Is doctype XHTML?

isXhtml() : bool
Inherited

inherited_from \Zend\View\Helper\AbstractHtmlElement::isXhtml()
inherited_from \Zend\View\Helper\Navigation\AbstractHelper::isXhtml()

Returns

bool

Normalize an ID

normalizeId(string $value) : string
Inherited

Overrides View\Helper\AbstractHtmlElement::normalizeId().

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::normalizeId()

Parameters

$value

string

Returns

string

Verifies container and eventually fetches it from service locator if it is a string

parseContainer(\Zend\Navigation\AbstractContainer | string | null $container) 
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::parseContainer()

Parameters

$container

\Zend\Navigation\AbstractContainerstringnull

Exceptions

\Zend\View\Exception\InvalidArgumentException

 Properties

 

ACL to use when iterating pages

$acl : \Zend\Permissions\Acl\Acl
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$acl
 

The tag closing bracket

$closingBracket : string
Inherited

inherited_from \Zend\View\Helper\AbstractHtmlElement::$$closingBracket
inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$closingBracket
 

AbstractContainer to operate on by default

$container : \Zend\Navigation\AbstractContainer
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$container
 

Default ACL to use when iterating pages if not explicitly set in the instance by calling {@link setAcl()}

$defaultAcl : \Zend\Permissions\Acl\Acl
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$defaultAcl
 

Default proxy to use in {@link render()}

$defaultProxy : string

 

Default ACL role to use when iterating pages if not explicitly set in the instance by calling {@link setRole()}

$defaultRole : string | \Zend\Permissions\Acl\Role\RoleInterface
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$defaultRole
 

Indentation string

$indent : string
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$indent
 

Whether ACL should be injected when proxying

$injectAcl : bool

 

Whether container should be injected when proxying

$injectContainer : bool

 

Whether translator should be injected when proxying

$injectTranslator : bool

 

Indicates whether or not a given helper has been injected

$injected : array

 

The maximum depth a page can have to be included when rendering

$maxDepth : int
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$maxDepth
 

The minimum depth a page must have to be included when rendering

$minDepth : int
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$minDepth
   

Whether invisible items should be rendered by this helper

$renderInvisible : bool
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$renderInvisible
 

ACL role to use when iterating pages

$role : string | \Zend\Permissions\Acl\Role\RoleInterface
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$role
 

$serviceLocator

$serviceLocator : \Zend\ServiceManager\ServiceLocatorInterface
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$serviceLocator
 

Translator (optional)

$translator : \Zend\I18n\Translator\Translator
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$translator
 

Whether translator should be used

$translatorEnabled : bool
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$translatorEnabled
 

Translator text domain (optional)

$translatorTextDomain : string
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$translatorTextDomain
 

Whether ACL should be used for filtering out pages

$useAcl : bool
Inherited

inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$useAcl
 

View object

$view : \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::$$view
inherited_from \Zend\View\Helper\AbstractHtmlElement::$$view
inherited_from \Zend\View\Helper\Navigation\AbstractHelper::$$view

 Constants

 

EOL character

EOL 
Inherited

inherited_from \Zend\View\Helper\AbstractHtmlElement::EOL
inherited_from \Zend\View\Helper\Navigation\AbstractHelper::EOL
 

View helper namespace

NS : string