API Documentation

Zend/View/Helper/Navigation.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_View  
Subpackage
Helper  
Version
$Id: Navigation.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_View_Helper_Navigation

Package: Zend\View\Helper

Proxy helper for retrieving navigational helpers and forwarding calls

Parent(s)
\Zend_View_Helper_Navigation_HelperAbstract < \Zend_View_Helper_HtmlElement < \Zend_View_Helper_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constantstring  NS = 'Zend_View_Helper_Navigation'

View helper namespace

string

Properties

Propertyprotectedstring  $_defaultProxy= ''menu''

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

Default value'menu'Details
Type
string
Propertyprotectedarray  $_helpers= 'array()'

Contains references to proxied helpers

Default valuearray()Details
Type
array
Propertyprotectedbool  $_injectAcl= 'true'

Whether ACL should be injected when proxying

Default valuetrueDetails
Type
bool
Propertyprotectedbool  $_injectContainer= 'true'

Whether container should be injected when proxying

Default valuetrueDetails
Type
bool
Propertyprotectedbool  $_injectTranslator= 'true'

Whether translator should be injected when proxying

Default valuetrueDetails
Type
bool

Methods

methodpublic__call( string $method, array $arguments = array() ) : mixed

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
Name Type Description
$method string

helper name or method name in container

$arguments array

[optional] arguments to pass

Returns
Type Description
mixed returns what the proxied call returns
Throws
Exception Description
\Zend_View_Exception if proxying to a helper, and the helper is not an instance of the interface specified in {@link findHelper()}
\Zend_Navigation_Exception if method does not exist in container
methodprotected_inject( \Zend_View_Helper_Navigation_Helper $helper ) : void

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

Parameters
Name Type Description
$helper \Zend_View_Helper_Navigation_Helper

helper instance

methodpublicfindHelper( string $proxy, bool $strict = true ) : \Zend_View_Helper_Navigation_Helper

Returns the helper matching $proxy

The helper must implement the interface {@link Zend_View_Helper_Navigation_Helper}.

Parameters
Name Type Description
$proxy string

helper name

$strict bool

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

Returns
Type Description
\Zend_View_Helper_Navigation_Helper helper instance
Throws
Exception Description
\Zend_Loader_PluginLoader_Exception if $strict is true and helper cannot be found
\Zend_View_Exception if $strict is true and helper does not implement the specified interface
methodpublicgetDefaultProxy( ) : string

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

Returns
Type Description
string the default proxy to use in {@link render()}
methodpublicgetInjectAcl( ) : bool

Returns whether ACL should be injected when proxying

Returns
Type Description
bool whether ACL should be injected when proxying
methodpublicgetInjectContainer( ) : bool

Returns whether container should be injected when proxying

Returns
Type Description
bool whether container should be injected when proxying
methodpublicgetInjectTranslator( ) : bool

Returns whether translator should be injected when proxying

Returns
Type Description
bool whether translator should be injected when proxying
methodpublicnavigation( \Zend_Navigation_Container $container = null ) : \Zend_View_Helper_Navigation

Helper entry point

Parameters
Name Type Description
$container \Zend_Navigation_Container

[optional] container to operate on

Returns
Type Description
\Zend_View_Helper_Navigation fluent interface, returns self
methodpublicrender( \Zend_Navigation_Container $container = null ) : string

Renders helper

Parameters
Name Type Description
$container \Zend_Navigation_Container

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

Returns
Type Description
string helper output
Throws
Exception Description
\Zend_Loader_PluginLoader_Exception if helper cannot be found
\Zend_View_Exception if helper doesn't implement the interface specified in {@link findHelper()}
methodpublicsetDefaultProxy( string $proxy ) : \Zend_View_Helper_Navigation

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

Parameters
Name Type Description
$proxy string

default proxy

Returns
Type Description
\Zend_View_Helper_Navigation fluent interface, returns self
methodpublicsetInjectAcl( bool $injectAcl = true ) : \Zend_View_Helper_Navigation

Sets whether ACL should be injected when proxying

Parameters
Name Type Description
$injectAcl bool

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

Returns
Type Description
\Zend_View_Helper_Navigation fluent interface, returns self
methodpublicsetInjectContainer( bool $injectContainer = true ) : \Zend_View_Helper_Navigation

Sets whether container should be injected when proxying

Parameters
Name Type Description
$injectContainer bool

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

Returns
Type Description
\Zend_View_Helper_Navigation fluent interface, returns self
methodpublicsetInjectTranslator( bool $injectTranslator = true ) : \Zend_View_Helper_Navigation

Sets whether translator should be injected when proxying

Parameters
Name Type Description
$injectTranslator bool

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

Returns
Type Description
\Zend_View_Helper_Navigation fluent interface, returns self
Documentation was generated by DocBlox 0.15.1.