Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_View_Helper_Navigation Class Reference

Public Member Functions

 navigation (Zend_Navigation_Container $container=null)
 Helper entry point.
 
 __call ($method, array $arguments=array())
 Magic overload: Proxy to other navigation helpers or the container.
 
 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.
 
 render (Zend_Navigation_Container $container=null)
 Renders helper.
 
- Public Member Functions inherited from Zend_View_Helper_Navigation_HelperAbstract
 setContainer (Zend_Navigation_Container $container=null)
 Sets navigation container the helper operates on by default.
 
 getContainer ()
 Returns the navigation container helper operates on by default.
 
 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.
 
 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.
 
 setIndent ($indent)
 Set the indentation string for using in render(), optionally a number of spaces to indent with.
 
 getIndent ()
 Returns indentation (format output is respected)
 
 getEOL ()
 Returns the EOL character (format output is respected)
 
 setFormatOutput ($formatOutput=true)
 Sets whether HTML/XML output should be formatted.
 
 getFormatOutput ()
 Returns whether HTML/XML output should be formatted.
 
 setPrefixForId ($prefix)
 Sets prefix for IDs when they are normalized.
 
 getPrefixForId ()
 Returns prefix for IDs when they are normalized.
 
 skipPrefixForId ($flag=true)
 Skip the current prefix for IDs when they are normalized.
 
 setTranslator ($translator=null)
 Sets translator to use in helper.
 
 getTranslator ()
 Returns translator used in helper.
 
 setAcl (Zend_Acl $acl=null)
 Sets ACL to use when iterating pages.
 
 getAcl ()
 Returns ACL or null if it isn't set using setAcl() or setDefaultAcl().
 
 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().
 
 setUseAcl ($useAcl=true)
 Sets whether ACL should be used.
 
 getUseAcl ()
 Returns whether ACL should be used.
 
 getRenderInvisible ()
 Return renderInvisible flag.
 
 setRenderInvisible ($renderInvisible=true)
 Render invisible items?
 
 setUseTranslator ($useTranslator=true)
 Sets whether translator should be used.
 
 getUseTranslator ()
 Returns whether translator should be used.
 
 __call ($method, array $arguments=array())
 Magic overload: Proxy calls to the navigation container.
 
 __toString ()
 Magic overload: Proxy to render().
 
 findActive (Zend_Navigation_Container $container, $minDepth=null, $maxDepth=-1)
 Finds the deepest active page in the given container.
 
 hasContainer ()
 Checks if the helper has a container.
 
 hasAcl ()
 Checks if the helper has an ACL instance.
 
 hasRole ()
 Checks if the helper has an ACL role.
 
 hasTranslator ()
 Checks if the helper has a translator.
 
 htmlify (Zend_Navigation_Page $page)
 Returns an HTML string containing an 'a' element for the given page.
 
 accept (Zend_Navigation_Page $page, $recursive=true)
 Determines whether a page should be accepted when iterating.
 
- Public Member Functions inherited from Zend_View_Helper_HtmlElement
 getClosingBracket ()
 Get the tag closing bracket.
 
- Public Member Functions inherited from Zend_View_Helper_Abstract
 setView (Zend_View_Interface $view)
 Set the View object.
 
 direct ()
 Strategy pattern: currently unutilized.
 

Public Attributes

const NS = 'Zend_View_Helper_Navigation'
 

Protected Member Functions

 _inject (Zend_View_Helper_Navigation_Helper $helper)
 Injects container, ACL, and translator to the given $helper if this helper is configured to do so.
 
- Protected Member Functions inherited from Zend_View_Helper_Navigation_HelperAbstract
 _acceptAcl (Zend_Navigation_Page $page)
 Determines whether a page should be accepted by ACL when iterating.
 
 _getWhitespace ($indent)
 Retrieve whitespace representation of $indent.
 
 _htmlAttribs ($attribs)
 Converts an associative array to a string of tag attributes.
 
 _normalizeId ($value)
 Normalize an ID.
 
- Protected Member Functions inherited from Zend_View_Helper_HtmlElement
 _isXhtml ()
 Is doctype XHTML?
 
 _isHtml5 ()
 Is doctype HTML5?
 
 _isStrictDoctype ()
 Is doctype strict?
 
 _htmlAttribs ($attribs)
 Converts an associative array to a string of tag attributes.
 
 _normalizeId ($value)
 Normalize an ID.
 

Protected Attributes

 $_defaultProxy = 'menu'
 
 $_helpers = array()
 
 $_injectContainer = true
 
 $_injectAcl = true
 
 $_injectTranslator = true
 
- Protected Attributes inherited from Zend_View_Helper_Navigation_HelperAbstract
 $_container
 
 $_minDepth
 
 $_maxDepth
 
 $_indent = ''
 
 $_formatOutput = true
 
 $_prefixForId = null
 
 $_skipPrefixForId = false
 
 $_translator
 
 $_acl
 
 $_renderInvisible = false
 
 $_role
 
 $_useTranslator = true
 
 $_useAcl = true
 
- Protected Attributes inherited from Zend_View_Helper_HtmlElement
 $_closingBracket = null
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_View_Helper_Navigation_HelperAbstract
static setDefaultAcl (Zend_Acl $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 Zend_View_Helper_Navigation_HelperAbstract
static $_defaultAcl
 
static $_defaultRole
 

Member Function Documentation

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

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
Returns
mixed returns what the proxied call returns
Exceptions
Zend_View_Exceptionif proxying to a helper, and the helper is not an instance of the interface specified in findHelper()
Zend_Navigation_Exceptionif method does not exist in container
_inject ( Zend_View_Helper_Navigation_Helper  $helper)
protected

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

Parameters
Zend_View_Helper_Navigation_Helper$helperhelper instance
Returns
void
findHelper (   $proxy,
  $strict = true 
)

Returns the helper matching $proxy.

The helper must implement the interface Zend_View_Helper_Navigation_Helper.

Parameters
string$proxyhelper name
bool$strict[optional] whether exceptions should be thrown if something goes wrong. Default is true.
Returns
Zend_View_Helper_Navigation_Helper helper instance
Exceptions
Zend_Loader_PluginLoader_Exceptionif $strict is true and helper cannot be found
Zend_View_Exceptionif $strict is true and helper does not implement the specified interface
getDefaultProxy ( )

Returns the default proxy to use in render().

Returns
string the default proxy to use in render()
getInjectAcl ( )

Returns whether ACL should be injected when proxying.

Returns
bool whether ACL should be injected when proxying
getInjectContainer ( )

Returns whether container should be injected when proxying.

Returns
bool whether container should be injected when proxying
getInjectTranslator ( )

Returns whether translator should be injected when proxying.

Returns
bool whether translator should be injected when proxying
navigation ( Zend_Navigation_Container  $container = null)

Helper entry point.

Parameters
Zend_Navigation_Container$container[optional] container to operate on
Returns
Zend_View_Helper_Navigation fluent interface, returns self
render ( Zend_Navigation_Container  $container = null)

Renders helper.

Parameters
Zend_Navigation_Container$container[optional] container to render. Default is to render the container registered in the helper.
Returns
string helper output
Exceptions
Zend_Loader_PluginLoader_Exceptionif helper cannot be found
Zend_View_Exceptionif helper doesn't implement the interface specified in findHelper()

Implements Zend_View_Helper_Navigation_Helper.

setDefaultProxy (   $proxy)

Sets the default proxy to use in render().

Parameters
string$proxydefault proxy
Returns
Zend_View_Helper_Navigation fluent interface, returns self
setInjectAcl (   $injectAcl = true)

Sets whether ACL should be injected when proxying.

Parameters
bool$injectAcl[optional] whether ACL should be injected when proxying. Default is true.
Returns
Zend_View_Helper_Navigation fluent interface, returns self
setInjectContainer (   $injectContainer = true)

Sets whether container should be injected when proxying.

Parameters
bool$injectContainer[optional] whether container should be injected when proxying. Default is true.
Returns
Zend_View_Helper_Navigation fluent interface, returns self
setInjectTranslator (   $injectTranslator = true)

Sets whether translator should be injected when proxying.

Parameters
bool$injectTranslator[optional] whether translator should be injected when proxying. Default is true.
Returns
Zend_View_Helper_Navigation fluent interface, returns self

Member Data Documentation

$_defaultProxy = 'menu'
protected
$_helpers = array()
protected
$_injectAcl = true
protected
$_injectContainer = true
protected
$_injectTranslator = true
protected