Methods
Magic overload: Proxy calls to {@link findRelation()} or container
__call(string $method, array $arguments) : mixed
Examples of finder calls:
// METHOD // SAME AS
$h->findRelNext($page); // $h->findRelation($page, 'rel', 'next')
$h->findRevSection($page); // $h->findRelation($page, 'rev', 'section');
$h->findRelFoo($page); // $h->findRelation($page, 'rel', 'foo');
Parameters
$method
string
method name
$arguments
array
method arguments
Exceptions
Returns
mixed
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
bool
whether 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
$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
array
an associative array with the values 'depth' and 'page', or an empty array if not found
Finds all relations (forward and reverse) for the given $page
findAllRelations(\Zend\Navigation\Page\AbstractPage $page, null | int $flag) : array
The form of the returned array:
// $page denotes an instance of Zend_Navigation_Page
$returned = array(
'rel' => array(
'alternate' => array($page, $page, $page),
'start' => array($page),
'next' => array($page),
'prev' => array($page),
'canonical' => array($page)
),
'rev' => array(
'section' => array($page)
)
);
Parameters
$flag
nullint
Returns
array
related pages
Finds relations of the given $rel=$type from $page
findRelation(\Zend\Navigation\Page\AbstractPage $page, string $rel, string $type) : \Zend\Navigation\Page\AbstractPage | array | null
This method will first look for relations in the page instance, then
by searching the root container if nothing was found in the page.
Parameters
$rel
string
relation, "rel" or "rev"
$type
string
link type, e.g. 'start', 'next'
Exceptions
Returns
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 indentation
getIndent() : string
Inherited
inherited_from |
\Zend\View\Helper\Navigation\AbstractHelper::getIndent() |
Returns
string
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
int
null
maximum 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
int
null
minimum depth or null
Returns the helper's render flag
getRenderFlag() : int
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
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
bool
whether 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
bool
whether 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
bool
whether 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
bool
whether 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
Returns
string
HTML 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 the given $page as a link element, with $attrib = $relation
renderLink(\Zend\Navigation\Page\AbstractPage $page, string $attrib, string $relation) : string
Parameters
$attrib
string
the attribute to use for $type, either 'rel' or 'rev'
$relation
string
relation type, muse be one of; alternate, appendix, bookmark, chapter, contents, copyright, glossary, help, home, index, next, prev, section, start, stylesheet, subsection
Exceptions
Returns
string
rendered link element
Searches the root container for forward 'chapter' relations of the given
$page
searchRelChapter(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | array | null
Searches the root container for the forward 'next' relation of the given
$page
searchRelNext(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | null
Searches the root container for the forward 'prev' relation of the given
$page
searchRelPrev(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | null
Searches the root container for forward 'section' relations of the given
$page
searchRelSection(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | array | null
Searches the root container for the forward 'start' relation of the given
$page
searchRelStart(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | null
From http://www.w3.org/TR/html4/types.html#type-links:
Refers to the first document in a collection of documents. This link type
tells search engines which document is considered by the author to be the
starting point of the collection.
Parameters
Returns
Searches the root container for forward 'subsection' relations of the
given $page
searchRelSubsection(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | array | null
Searches the root container for the reverse 'section' relation of the
given $page
searchRevSection(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | null
Searches the root container for the reverse 'section' relation of the
given $page
searchRevSubsection(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\Page\AbstractPage | null
Sets default ACL to use if another ACL is not explicitly set
setDefaultAcl(\Zend\Permissions\Acl\AclInterface $acl) : void
Inherited
inherited_from |
\Zend\View\Helper\Navigation\AbstractHelper::setDefaultAcl() |
Parameters
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
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
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
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
Sets the helper's render flag
setRenderFlag(int $renderFlag) : \Zend\View\Helper\Navigation\Links
The helper uses the bitwise '&' operator against the hex values of the
render constants. This means that the flag can is "bitwised" value of
the render constants. Examples:
// render all links except glossary
$flag = Links:RENDER_ALL ^ Links:RENDER_GLOSSARY;
$helper->setRenderFlag($flag);
// render only chapters and sections
$flag = Links:RENDER_CHAPTER | Links:RENDER_SECTION;
$helper->setRenderFlag($flag);
// render only relations that are not native W3C relations
$helper->setRenderFlag(Links:RENDER_CUSTOM);
// render all relations (default)
$helper->setRenderFlag(Links:RENDER_ALL);
Note that custom relations can also be rendered directly using the
renderLink() method.
Parameters
$renderFlag
int
render flag
Returns
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
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
Returns
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
$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
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
bool
whether page is accepted by ACL
Converts a $mixed value to an array of pages
convertToPages(mixed $mixed, bool $recursive) : \Zend\Navigation\Page\AbstractPage | array | null
Parameters
$mixed
mixed
mixed value to get page(s) from
$recursive
bool
whether $value should be looped if it is an array or a config
Returns
Finds relations of given $type for $page by checking if the
relation is specified as a property of $page
findFromProperty(\Zend\Navigation\Page\AbstractPage $page, string $rel, string $type) : \Zend\Navigation\Page\AbstractPage | array | null
Parameters
$rel
string
relation, 'rel' or 'rev'
$type
string
link type, e.g. 'start', 'next'
Returns
Finds relations of given $rel=$type for $page by using the helper to
search for the relation in the root container
findFromSearch(\Zend\Navigation\Page\AbstractPage $page, string $rel, string $type) : array | null
Parameters
$rel
string
relation, 'rel' or 'rev'
$type
string
link type, e.g. 'start', 'next', etc
Returns
array
null
array of pages, or null if not found
Returns the root container of the given page
findRoot(\Zend\Navigation\Page\AbstractPage $page) : \Zend\Navigation\AbstractContainer
When rendering a container, the render method still store the given
container as the root container, and unset it when done rendering. This
makes sure finder methods will not traverse above the container given
to the render method.
Parameters
Returns
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
string
an attribute string
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
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
Exceptions
Properties
Maps render constants to W3C link types
$RELATIONS : array
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\AclInterface
Inherited
inherited_from |
\Zend\View\Helper\Navigation\AbstractHelper::$$defaultAcl |
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 |
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 |
The helper's render flag
$renderFlag : int
see |
\Zend\View\Helper\Navigation\render() |
see |
\Zend\View\Helper\Navigation\setRenderFlag() |
Whether invisible items should be rendered by this helper
$renderInvisible : bool
Inherited
inherited_from |
\Zend\View\Helper\Navigation\AbstractHelper::$$renderInvisible |
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 |
RENDER_ALTERNATE
RENDER_ALTERNATE
RENDER_APPENDIX
RENDER_APPENDIX
RENDER_BOOKMARK
RENDER_BOOKMARK
RENDER_CHAPTER
RENDER_CHAPTER
RENDER_CONTENTS
RENDER_CONTENTS
RENDER_COPYRIGHT
RENDER_COPYRIGHT
RENDER_CUSTOM
RENDER_CUSTOM
RENDER_GLOSSARY
RENDER_GLOSSARY
RENDER_INDEX
RENDER_INDEX
RENDER_SECTION
RENDER_SECTION
RENDER_START
RENDER_START
RENDER_STYLESHEET
RENDER_STYLESHEET
RENDER_SUBSECTION
RENDER_SUBSECTION