Zend Framework
3.0
|
Base class for navigational helpers. More...
Public Member Functions | |
__call ($method, array $arguments=[]) | |
Magic overload: Proxy calls to the navigation container. | |
__toString () | |
Magic overload: Proxy to render(). | |
accept (AbstractPage $page, $recursive=true) | |
Determines whether a page should be accepted when iterating. | |
setAcl (Acl\AclInterface $acl=null) | |
Sets ACL to use when iterating pages. | |
getAcl () | |
Returns ACL or null if it isn't set using setAcl() or setDefaultAcl(). | |
hasAcl () | |
Checks if the helper has an ACL instance. | |
setEventManager (EventManagerInterface $events) | |
Set the event manager. | |
getEventManager () | |
Get the event manager, if present. | |
setContainer ($container=null) | |
Sets navigation container the helper operates on by default. | |
getContainer () | |
Returns the navigation container helper operates on by default. | |
hasContainer () | |
Checks if the helper has a container. | |
setIndent ($indent) | |
Set the indentation string for using in render(), optionally a number of spaces to indent with. | |
getIndent () | |
Returns indentation. | |
setMaxDepth ($maxDepth=null) | |
Sets the maximum depth a page can have to be included when rendering. | |
getMaxDepth () | |
Returns maximum depth a page can have to be included when rendering. | |
setMinDepth ($minDepth=null) | |
Sets the minimum depth a page must have to be included when rendering. | |
getMinDepth () | |
Returns minimum depth a page must have to be included when rendering. | |
setRenderInvisible ($renderInvisible=true) | |
Render invisible items? | |
getRenderInvisible () | |
Return renderInvisible flag. | |
setRole ($role=null) | |
Sets ACL role(s) to use when iterating pages. | |
getRole () | |
Returns ACL role to use when iterating pages, or null if it isn't set using setRole() or setDefaultRole(). | |
hasRole () | |
Checks if the helper has an ACL role. | |
setServiceLocator (ContainerInterface $serviceLocator) | |
Set the service locator. | |
getServiceLocator () | |
Get the service locator. | |
setUseAcl ($useAcl=true) | |
Sets whether ACL should be used. | |
getUseAcl () | |
Returns whether ACL should be used. | |
Public Member Functions inherited from AbstractHtmlElement | |
getClosingBracket () | |
Get the tag closing bracket. | |
Public Member Functions inherited from AbstractHelper | |
setView (Renderer $view) | |
Set the View object. | |
getView () | |
Get the view object. | |
Public Member Functions inherited from HelperInterface | |
render ($container=null) | |
Renders helper. | |
Static Public Member Functions | |
static | setDefaultAcl (Acl\AclInterface $acl=null) |
Sets default ACL to use if another ACL is not explicitly set. | |
static | setDefaultRole ($role=null) |
Sets default ACL role(s) to use when iterating pages if not explicitly set later with setRole(). | |
Protected Member Functions | |
parseContainer (&$container=null) | |
Verifies container and eventually fetches it from service locator if it is a string. | |
isAllowed ($params) | |
Determines whether a page should be allowed given certain parameters. | |
getWhitespace ($indent) | |
Retrieve whitespace representation of $indent. | |
htmlAttribs ($attribs) | |
Converts an associative array to a string of tag attributes. | |
translate ($message, $textDomain=null) | |
Translate a message (for label, title, …) | |
normalizeId ($value) | |
Normalize an ID. | |
setDefaultListeners () | |
Attaches default ACL listeners, if ACLs are in use. | |
Protected Member Functions inherited from AbstractHtmlElement | |
isXhtml () | |
Is doctype XHTML? | |
htmlAttribs ($attribs) | |
Converts an associative array to a string of tag attributes. | |
normalizeId ($value) | |
Normalize an ID. | |
Protected Attributes | |
$events | |
$container | |
$minDepth | |
$maxDepth | |
$indent = '' | |
$acl | |
$renderInvisible = false | |
$role | |
$serviceLocator | |
$useAcl = true | |
Protected Attributes inherited from AbstractHtmlElement | |
$closingBracket = null | |
Protected Attributes inherited from AbstractHelper | |
$view = null | |
Static Protected Attributes | |
static | $defaultAcl |
static | $defaultRole |
Additional Inherited Members | |
Public Attributes inherited from AbstractHtmlElement | |
const | EOL = PHP_EOL |
EOL character. | |
Base class for navigational helpers.
Duck-types against Zend.
__call | ( | $method, | |
array | $arguments = [] |
||
) |
Magic overload: Proxy calls to the navigation container.
string | $method | method name in container |
array | $arguments | rguments to pass |
Navigation\Exception\ExceptionInterface |
__toString | ( | ) |
Magic overload: Proxy to render().
This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.
Implements HelperInterface::__toString().
Implements HelperInterface.
accept | ( | AbstractPage | $page, |
$recursive = true |
|||
) |
Determines whether a page should be accepted when iterating.
Default listener may be 'overridden' by attaching listener to 'isAllowed' method. Listener must be 'short circuited' if overriding default ACL listener.
Rules:
AbstractPage | $page | page to check |
bool | $recursive | [optional] if true, page will not be accepted if it is the descendant of a page that is not accepted. Default is true |
getAcl | ( | ) |
Returns ACL or null if it isn't set using setAcl() or setDefaultAcl().
Implements HelperInterface::getAcl().
Implements HelperInterface.
getContainer | ( | ) |
Returns the navigation container helper operates on by default.
Implements HelperInterface::getContainer().
If no container is set, a new container will be instantiated and stored in the helper.
Implements HelperInterface.
getEventManager | ( | ) |
Get the event manager, if present.
Internally, the helper will lazy-load an EM instance the first time it requires one, but ideally it should be injected during instantiation.
Implements EventsCapableInterface.
getIndent | ( | ) |
Returns indentation.
getMaxDepth | ( | ) |
Returns maximum depth a page can have to be included when rendering.
getMinDepth | ( | ) |
Returns minimum depth a page must have to be included when rendering.
getRenderInvisible | ( | ) |
getRole | ( | ) |
Returns ACL role to use when iterating pages, or null if it isn't set using setRole() or setDefaultRole().
Implements HelperInterface::getRole().
Implements HelperInterface.
getServiceLocator | ( | ) |
Get the service locator.
Used internally to pull named navigation containers to render.
getUseAcl | ( | ) |
Returns whether ACL should be used.
Implements HelperInterface::getUseAcl().
Implements HelperInterface.
|
protected |
Retrieve whitespace representation of $indent.
int | string | $indent |
hasAcl | ( | ) |
Checks if the helper has an ACL instance.
Implements HelperInterface::hasAcl().
Implements HelperInterface.
hasContainer | ( | ) |
Checks if the helper has a container.
Implements HelperInterface::hasContainer().
Implements HelperInterface.
hasRole | ( | ) |
Checks if the helper has an ACL role.
Implements HelperInterface::hasRole().
Implements HelperInterface.
|
protected |
Converts an associative array to a string of tag attributes.
Overloads ::htmlAttribs().
array | $attribs | an array where each key-value pair is converted to an attribute name and value |
|
protected |
Determines whether a page should be allowed given certain parameters.
array | $params |
|
protected |
|
protected |
Verifies container and eventually fetches it from service locator if it is a string.
Navigation\AbstractContainer | string | null | $container |
Exception\InvalidArgumentException |
Load the navigation container from the root service locator
setAcl | ( | Acl\AclInterface | $acl = null | ) |
Sets ACL to use when iterating pages.
Implements HelperInterface::setAcl().
Acl\AclInterface | $acl | ACL object. |
Implements HelperInterface.
setContainer | ( | $container = null | ) |
Sets navigation container the helper operates on by default.
Implements HelperInterface::setContainer().
string | Navigation\AbstractContainer | $container | Default is null, meaning container will be reset. |
Implements HelperInterface.
|
static |
Sets default ACL to use if another ACL is not explicitly set.
Acl\AclInterface | $acl | [optional] ACL object. Default is null, which sets no ACL object. |
|
protected |
Attaches default ACL listeners, if ACLs are in use.
|
static |
Sets default ACL role(s) to use when iterating pages if not explicitly set later with setRole().
mixed | $role | [optional] role to set. Expects null, string, or an instance of Acl. Default is null, which sets no default role. |
Exception\InvalidArgumentException | if role is invalid |
setEventManager | ( | EventManagerInterface | $events | ) |
Set the event manager.
EventManagerInterface | $events |
Implements EventManagerAwareInterface.
setIndent | ( | $indent | ) |
Set the indentation string for using in render(), optionally a number of spaces to indent with.
string | int | $indent |
setMaxDepth | ( | $maxDepth = null | ) |
Sets the maximum depth a page can have to be included when rendering.
int | $maxDepth | Default is null, which sets no maximum depth. |
setMinDepth | ( | $minDepth = null | ) |
Sets the minimum depth a page must have to be included when rendering.
int | $minDepth | Default is null, which sets no minimum depth. |
setRenderInvisible | ( | $renderInvisible = true | ) |
Render invisible items?
bool | $renderInvisible |
Implements HelperInterface.
setRole | ( | $role = null | ) |
Sets ACL role(s) to use when iterating pages.
Implements HelperInterface::setRole().
mixed | $role | [optional] role to set. Expects a string, an instance of type Acl, or null. Default is null, which will set no role. |
Exception\InvalidArgumentException |
Implements HelperInterface.
setServiceLocator | ( | ContainerInterface | $serviceLocator | ) |
Set the service locator.
Used internally to pull named navigation containers to render.
ContainerInterface | $serviceLocator |
setUseAcl | ( | $useAcl = true | ) |
Sets whether ACL should be used.
Implements HelperInterface::setUseAcl().
bool | $useAcl |
Implements HelperInterface.
|
protected |
Translate a message (for label, title, …)
string | $message | ID of the message to translate |
string | $textDomain | Text domain (category name for the translations) |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |