Class Zend_View_Helper_Navigation_Menu

Description

Helper for rendering menus from navigation containers

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /View/Helper/Navigation/Menu.php (line 37)

Zend_View_Helper_Abstract
   |
   --Zend_View_Helper_HtmlElement
      |
      --Zend_View_Helper_Navigation_HelperAbstract
         |
         --Zend_View_Helper_Navigation_Menu
Variable Summary
 string|array $_partial
 string $_ulClass
Method Summary
 string|array|null getPartial ()
 string getUlClass ()
 string htmlify ( $page)
 Zend_View_Helper_Navigation_Menu menu ([ $container = null])
 string render ([ $container = null])
 string renderMenu ([ $container = null], [ $options = array()])
 string renderPartial ([ $container = null], [string|array $partial = null])
 string renderSubMenu ([ $container = null], [string $ulClass = null], [string|int $indent = null])
 Zend_View_Helper_Navigation_Menu setPartial (string|array $partial)
 array _normalizeOptions ([ $options = array()])
 string _renderDeepestMenu ( $container, string $ulClass, string $indent, int|null $minDepth, int|null $maxDepth, array $active)
 string _renderMenu ( $container, string $ulClass, string $indent, int|null $minDepth, int|null $maxDepth, bool $onlyActive)
Variables
Methods
getOnlyActiveBranch (line 134)

Returns a flag indicating whether only active branch should be rendered

By default, this value is false, meaning the entire menu will be be rendered.

  • return: whether only active branch should be rendered
  • access: public
bool getOnlyActiveBranch ()
getPartial (line 193)

Returns partial view script to use for rendering menu

  • access: public
string|array|null getPartial ()
getRenderParents (line 163)

Returns flag indicating whether parents should be rendered when rendering only the active branch

By default, this value is true.

  • return: whether parents should be rendered
  • access: public
bool getRenderParents ()
getUlClass (line 108)

Returns CSS class to use for the first 'ul' element when rendering

  • return: CSS class
  • access: public
string getUlClass ()
htmlify (line 209)

Returns an HTML string containing an 'a' element for the given page if the page's href is not empty, and a 'span' element if it is empty

Overrides Zend_View_Helper_Navigation_Abstract::htmlify().

  • return: HTML string for the given page
  • access: public
string htmlify ( $page)

Redefinition of:
Zend_View_Helper_Navigation_HelperAbstract::htmlify()
Returns an HTML string containing an 'a' element for the given page
menu (line 77)

View helper entry point: Retrieves helper and optionally sets container to operate on

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_Menu menu ([ $container = null])
render (line 639)

Renders menu

Implements Zend_View_Helper_Navigation_Helper::render().

If a partial view is registered in the helper, the menu will be rendered using the given partial script. If no partial is registered, the menu will be rendered as an 'ul' element by the helper's internal method.

string render ([ $container = null])
  • Zend_Navigation_Container $container: [optional] container to render. Default is to render the container registered in the helper.
renderMenu (line 484)

Renders helper

Renders a HTML 'ul' for the given $container. If $container is not given, the container registered in the helper will be used.

Available $options:

  • return: rendered menu
  • access: public
string renderMenu ([ $container = null], [ $options = array()])
  • Zend_Navigation_Container $container: [optional] container to create menu from. Default is to use the container retrieved from getContainer().
  • array $options: [optional] options for controlling rendering
renderPartial (line 577)

Renders the given $container by invoking the partial view helper

The container will simply be passed on as a model to the view script as-is, and will be available in the partial script as 'container', e.g.

  1. echo 'Number of pages: 'count($this->container);
.

  • return: helper output
  • access: public
string renderPartial ([ $container = null], [string|array $partial = null])
  • Zend_Navigation_Container $container: [optional] container to pass to view script. Default is to use the container registered in the helper.
  • string|array $partial: [optional] partial view script to use. Default is to use the partial registered in the helper. If an array is given, it is expected to contain two values; the partial view script to use, and the module where the script can be found.
renderSubMenu (line 541)

Renders the inner-most sub menu for the active page in the $container

This is a convenience method which is equivalent to the following call:

  1.  renderMenu($containerarray(
  2.      'indent'           => $indent,
  3.      'ulClass'          => $ulClass,
  4.      'minDepth'         => null,
  5.      'maxDepth'         => null,
  6.      'onlyActiveBranch' => true,
  7.      'renderParents'    => false
  8.  ));

  • return: rendered content
  • access: public
string renderSubMenu ([ $container = null], [string $ulClass = null], [string|int $indent = null])
  • Zend_Navigation_Container $container: [optional] container to render. Default is to render the container registered in the helper.
  • string $ulClass: [optional] CSS class to use for UL element. Default is to use the value from getUlClass().
  • string|int $indent: [optional] indentation as a string or number of spaces. Default is to use the value retrieved from getIndent().
setOnlyActiveBranch (line 120)

Sets a flag indicating whether only active branch should be rendered

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_Menu setOnlyActiveBranch ([bool $flag = true])
  • bool $flag: [optional] render only active branch. Default is true.
setPartial (line 179)

Sets which partial view script to use for rendering menu

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_Menu setPartial (string|array $partial)
  • string|array $partial: partial view script or null. If an array is given, it is expected to contain two values; the partial view script to use, and the module where the script can be found.
setRenderParents (line 149)

Enables/disables rendering of parents when only rendering active branch

See setOnlyActiveBranch() for more information.

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_Menu setRenderParents ([bool $flag = true])
  • bool $flag: [optional] render parents when rendering active branch. Default is true.
setUlClass (line 94)

Sets CSS class to use for the first 'ul' element when rendering

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_Menu setUlClass (string $ulClass)
  • string $ulClass: CSS class to set
_normalizeOptions (line 252)

Normalizes given render options

  • return: normalized options
  • access: protected
array _normalizeOptions ([ $options = array()])
  • array $options: [optional] options to normalize
_renderDeepestMenu (line 311)

Renders the deepest active menu within [$minDepth, $maxDeth], (called from renderMenu())

  • return: rendered menu
  • access: protected
string _renderDeepestMenu ( $container, string $ulClass, string $indent, int|null $minDepth, int|null $maxDepth, array $active)
  • Zend_Navigation_Container $container: container to render
  • array $active: active page and depth
  • string $ulClass: CSS class for first UL
  • string $indent: initial indentation
  • int|null $minDepth: minimum depth
  • int|null $maxDepth: maximum depth
_renderMenu (line 363)

Renders a normal menu (called from renderMenu())

  • access: protected
string _renderMenu ( $container, string $ulClass, string $indent, int|null $minDepth, int|null $maxDepth, bool $onlyActive)
  • Zend_Navigation_Container $container: container to render
  • string $ulClass: CSS class for first UL
  • string $indent: initial indentation
  • int|null $minDepth: minimum depth
  • int|null $maxDepth: maximum depth
  • bool $onlyActive: render only active branch?

Inherited Methods

Inherited From Zend_View_Helper_Navigation_HelperAbstract

 Zend_View_Helper_Navigation_HelperAbstract::accept()
 Zend_View_Helper_Navigation_HelperAbstract::findActive()
 Zend_View_Helper_Navigation_HelperAbstract::getAcl()
 Zend_View_Helper_Navigation_HelperAbstract::getContainer()
 Zend_View_Helper_Navigation_HelperAbstract::getIndent()
 Zend_View_Helper_Navigation_HelperAbstract::getMaxDepth()
 Zend_View_Helper_Navigation_HelperAbstract::getMinDepth()
 Zend_View_Helper_Navigation_HelperAbstract::getRenderInvisible()
 Zend_View_Helper_Navigation_HelperAbstract::getRole()
 Zend_View_Helper_Navigation_HelperAbstract::getTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::getUseAcl()
 Zend_View_Helper_Navigation_HelperAbstract::getUseTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::hasAcl()
 Zend_View_Helper_Navigation_HelperAbstract::hasContainer()
 Zend_View_Helper_Navigation_HelperAbstract::hasRole()
 Zend_View_Helper_Navigation_HelperAbstract::hasTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::htmlify()
 Zend_View_Helper_Navigation_HelperAbstract::setAcl()
 Zend_View_Helper_Navigation_HelperAbstract::setContainer()
 Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl()
 Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole()
 Zend_View_Helper_Navigation_HelperAbstract::setIndent()
 Zend_View_Helper_Navigation_HelperAbstract::setMaxDepth()
 Zend_View_Helper_Navigation_HelperAbstract::setMinDepth()
 Zend_View_Helper_Navigation_HelperAbstract::setRenderInvisible()
 Zend_View_Helper_Navigation_HelperAbstract::setRole()
 Zend_View_Helper_Navigation_HelperAbstract::setTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::setUseAcl()
 Zend_View_Helper_Navigation_HelperAbstract::setUseTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::_acceptAcl()
 Zend_View_Helper_Navigation_HelperAbstract::_getWhitespace()
 Zend_View_Helper_Navigation_HelperAbstract::_htmlAttribs()
 Zend_View_Helper_Navigation_HelperAbstract::_normalizeId()
 Zend_View_Helper_Navigation_HelperAbstract::__call()
 Zend_View_Helper_Navigation_HelperAbstract::__toString()

Inherited From Zend_View_Helper_HtmlElement

 Zend_View_Helper_HtmlElement::getClosingBracket()
 Zend_View_Helper_HtmlElement::_htmlAttribs()
 Zend_View_Helper_HtmlElement::_isXhtml()
 Zend_View_Helper_HtmlElement::_normalizeId()

Inherited From Zend_View_Helper_Abstract

 Zend_View_Helper_Abstract::direct()
 Zend_View_Helper_Abstract::setView()
Class Constants

Documentation generated on Mon, 21 Jun 2010 15:33:42 -0400 by phpDocumentor 1.4.3