Base class for navigational helpers
Set the service locator.
Parameters: | ServiceLocatorInterface – |
---|---|
Return type: | AbstractHelper |
Get the service locator.
Return type: | ZendServiceManagerServiceLocatorInterface |
---|
Sets navigation container the helper operates on by default
Implements {@link HelperInterface::setContainer()}.
Parameters: | string|NavigationAbstractContainer – [optional] container to operate on. Default is null, meaning container will be reset. |
---|---|
Return type: | AbstractHelper fluent interface, returns self |
Verifies container and eventually fetches it from service locator if it is a string
Parameters: | NavigationAbstractContainer|string|null – |
---|---|
Throws ExceptionInvalidArgumentException: | |
Sets the minimum depth a page must have to be included when rendering
Parameters: | int – [optional] minimum depth. Default is null, which sets no minimum depth. |
---|---|
Return type: | AbstractHelper fluent interface, returns self |
Returns minimum depth a page must have to be included when rendering
Return type: | int|null minimum depth or null |
---|
Sets the maximum depth a page can have to be included when rendering
Parameters: | int – [optional] maximum depth. Default is null, which sets no maximum depth. |
---|---|
Return type: | AbstractHelper fluent interface, returns self |
Returns maximum depth a page can have to be included when rendering
Return type: | int|null maximum depth or null |
---|
Sets ACL role(s) to use when iterating pages
Implements {@link HelperInterface::setRole()}.
Parameters: | mixed – [optional] role to set. Expects a string, an instance of type {@link AclRoleRoleInterface}, or null. Default is null, which will set no role. |
---|---|
Return type: | AbstractHelper fluent interface, returns self |
Throws : | ExceptionInvalidArgumentException if $role is invalid |
Render invisible items?
Parameters: | bool – [optional] boolean flag |
---|---|
Return type: | AbstractHelper fluent interface returns self |
Magic overload: Proxy calls to the navigation container
Parameters: |
|
---|---|
Return type: | mixed returns what the container returns |
Throws : | NavigationExceptionExceptionInterface if method does not exist in container |
Finds the deepest active page in the given container
Parameters: |
|
---|---|
Return type: | array an associative array with the values ‘depth’ and ‘page’, or an empty array if not found |
Returns an HTML string containing an ‘a’ element for the given page
Parameters: | AbstractPage – page to generate HTML for |
---|---|
Return type: | string HTML string for the given page |
Sets translator to use in helper
Parameters: |
|
---|---|
Return type: | AbstractHelper |
Returns translator used in helper
Return type: | Translator|null |
---|
Sets whether translator is enabled and should be used
Parameters: | bool – [optional] whether translator should be used. Default is true. |
---|---|
Return type: | AbstractHelper |
Returns whether translator is enabled and should be used
Return type: | bool |
---|
Set translation text domain
Parameters: | string – |
---|---|
Return type: | AbstractHelper |
Return the translation text domain
Return type: | string |
---|
Determines whether a page should be accepted when iterating
Rules: - If a page is not visible it is not accepted, unless RenderInvisible has
been set to true.
- Page is accepted if it has no resource or privilege
- Page is accepted if ACL allows page’s resource or privilege
Parameters: |
|
---|---|
Return type: | bool whether page should be accepted |
Determines whether a page should be accepted by ACL when iterating
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
Parameters: | AbstractPage – page to check |
---|---|
Return type: | bool whether page is accepted by ACL |
Retrieve whitespace representation of $indent
Parameters: | int|string – |
---|---|
Return type: | string |
Sets default ACL to use if another ACL is not explicitly set
Parameters: | AclAclInterface – [optional] ACL object. Default is null, which sets no ACL object. |
---|---|
Return type: | void |
Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()}
Parameters: | mixed – [optional] role to set. Expects null, string, or an instance of {@link AclRoleRoleInterface}. Default is null, which sets no default role. |
---|---|
Return type: | void |
Throws : | ExceptionInvalidArgumentException if role is invalid |
Full-text doc search.
Enter search terms or a module, class or function name.