Zend Framework  3.0
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Navigation Class Reference

Proxy helper for retrieving navigational helpers and forwarding calls. More...

Public Member Functions

 __invoke ($container=null)
 Helper entry point.
 
 __call ($method, array $arguments=[])
 Magic overload: Proxy to other navigation helpers or the container.
 
 render ($container=null)
 Renders helper.
 
 findHelper ($proxy, $strict=true)
 Returns the helper matching $proxy.
 
 setDefaultProxy ($proxy)
 Sets the default proxy to use in render().
 
 getDefaultProxy ()
 Returns the default proxy to use in render().
 
 setInjectContainer ($injectContainer=true)
 Sets whether container should be injected when proxying.
 
 getInjectContainer ()
 Returns whether container should be injected when proxying.
 
 setInjectAcl ($injectAcl=true)
 Sets whether ACL should be injected when proxying.
 
 getInjectAcl ()
 Returns whether ACL should be injected when proxying.
 
 setInjectTranslator ($injectTranslator=true)
 Sets whether translator should be injected when proxying.
 
 getInjectTranslator ()
 Returns whether translator should be injected when proxying.
 
 setPluginManager (Navigation\PluginManager $plugins)
 Set manager for retrieving navigation helpers.
 
 getPluginManager ()
 Retrieve plugin loader for navigation helpers.
 
 setView (Renderer $view)
 Set the View object.
 
- Public Member Functions inherited from AbstractHelper
 __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 Attributes

const NS = 'Zend\View\Helper\Navigation'
 

Protected Member Functions

 inject (NavigationHelper $helper)
 Injects container, ACL, and translator to the given $helper if this helper is configured to do so.
 
- Protected Member Functions inherited from AbstractHelper
 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

 $defaultProxy = 'menu'
 
 $injected = []
 
 $injectAcl = true
 
 $injectContainer = true
 
 $injectTranslator = true
 
 $plugins
 
- Protected Attributes inherited from AbstractHelper
 $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
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractHelper
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().
 
- Static Protected Attributes inherited from AbstractHelper
static $defaultAcl
 
static $defaultRole
 

Detailed Description

Proxy helper for retrieving navigational helpers and forwarding calls.

Member Function Documentation

__call (   $method,
array  $arguments = [] 
)

Magic overload: Proxy to other navigation helpers or the container.

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
string$methodhelper name or method name in container
array$arguments[optional] arguments to pass
Exceptions
\Zend\View\Exception\ExceptionInterfaceif proxying to a helper, and the helper is not an instance of the interface specified in findHelper()
\Zend\Navigation\Exception\ExceptionInterfaceif method does not exist in container
Returns
mixed returns what the proxied call returns
__invoke (   $container = null)

Helper entry point.

Parameters
string | AbstractContainer$containercontainer to operate on
Returns
Navigation
findHelper (   $proxy,
  $strict = true 
)

Returns the helper matching $proxy.

The helper must implement the interface Zend.

Parameters
string$proxyhelper name
bool$strict[optional] whether exceptions should be thrown if something goes wrong. Default is true.
Exceptions
Exception\RuntimeExceptionif $strict is true and helper cannot be found
Returns
helper instance
getDefaultProxy ( )

Returns the default proxy to use in render().

Returns
string
getInjectAcl ( )

Returns whether ACL should be injected when proxying.

Returns
bool
getInjectContainer ( )

Returns whether container should be injected when proxying.

Returns
bool
getInjectTranslator ( )

Returns whether translator should be injected when proxying.

Returns
bool
getPluginManager ( )

Retrieve plugin loader for navigation helpers.

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

Returns
Navigation
inject ( NavigationHelper  $helper)
protected

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

Parameters
NavigationHelper$helperhelper instance
Returns
void
render (   $container = null)

Renders helper.

Parameters
AbstractContainer$container
Returns
string
Exceptions
Exception\RuntimeException

Implements HelperInterface.

setDefaultProxy (   $proxy)

Sets the default proxy to use in render().

Parameters
string$proxydefault proxy
Returns
Navigation
setInjectAcl (   $injectAcl = true)

Sets whether ACL should be injected when proxying.

Parameters
bool$injectAcl
Returns
Navigation
setInjectContainer (   $injectContainer = true)

Sets whether container should be injected when proxying.

Parameters
bool$injectContainer
Returns
Navigation
setInjectTranslator (   $injectTranslator = true)

Sets whether translator should be injected when proxying.

Parameters
bool$injectTranslator
Returns
Navigation
setPluginManager ( Navigation\PluginManager  $plugins)

Set manager for retrieving navigation helpers.

Parameters
Navigation\PluginManager$plugins
Returns
Navigation
setView ( Renderer  $view)

Set the View object.

Parameters
Renderer$view
Returns
self

Implements HelperInterface.

Member Data Documentation

$defaultProxy = 'menu'
protected
$injectAcl = true
protected
$injectContainer = true
protected
$injected = []
protected
$injectTranslator = true
protected
$plugins
protected