Zend Framework
1.12
|
Public Member Functions | |
menu (Zend_Navigation_Container $container=null) | |
View helper entry point: Retrieves helper and optionally sets container to operate on. | |
setUlClass ($ulClass) | |
Sets CSS class to use for the first 'ul' element when rendering. | |
getUlClass () | |
Returns CSS class to use for the first 'ul' element when rendering. | |
setUlId ($ulId) | |
Sets unique identifier (id) to use for the first 'ul' element when rendering. | |
getUlId () | |
Returns unique identifier (id) to use for the first 'ul' element when rendering. | |
setActiveClass ($activeClass) | |
Sets CSS class to use for the active elements when rendering. | |
getActiveClass () | |
Returns CSS class to use for the active elements when rendering. | |
setParentClass ($parentClass) | |
Sets CSS class to use for the parent li elements when rendering. | |
getParentClass () | |
Returns CSS class to use for the parent lie elements when rendering. | |
setRenderParentClass ($flag=true) | |
Enables/disables rendering of parent class to the li element. | |
getRenderParentClass () | |
Returns flag indicating whether parent class should be rendered to the li element. | |
setOnlyActiveBranch ($flag=true) | |
Sets a flag indicating whether only active branch should be rendered. | |
getOnlyActiveBranch () | |
Returns a flag indicating whether only active branch should be rendered. | |
setExpandSiblingNodesOfActiveBranch ($flag=true) | |
Sets a flag indicating whether to expand all sibling nodes of the active branch. | |
getExpandSiblingNodesOfActiveBranch () | |
Returns a flag indicating whether to expand all sibling nodes of the active branch. | |
setRenderParents ($flag=true) | |
Enables/disables rendering of parents when only rendering active branch. | |
getRenderParents () | |
Returns flag indicating whether parents should be rendered when rendering only the active branch. | |
setPartial ($partial) | |
Sets which partial view script to use for rendering menu. | |
getPartial () | |
Returns partial view script to use for rendering menu. | |
addPageClassToLi ($flag=true) | |
Adds CSS class from page to li element. | |
getAddPageClassToLi () | |
Returns a flag indicating whether the CSS class from page to be added to li element. | |
setInnerIndent ($indent) | |
Set the inner indentation string for using in render(), optionally a number of spaces to indent with. | |
getInnerIndent () | |
Returns inner indentation (format output is respected) | |
htmlify (Zend_Navigation_Page $page) | |
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. | |
renderMenu (Zend_Navigation_Container $container=null, array $options=array()) | |
Renders helper. | |
renderSubMenu (Zend_Navigation_Container $container=null, $ulClass=null, $indent=null, $ulId=null, $addPageClassToLi=false, $innerIndent=null) | |
Renders the inner-most sub menu for the active page in the $container. | |
renderPartial (Zend_Navigation_Container $container=null, $partial=null) | |
Renders the given $container by invoking the partial view helper. | |
render (Zend_Navigation_Container $container=null) | |
Renders menu. | |
![]() | |
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. | |
![]() | |
getClosingBracket () | |
Get the tag closing bracket. | |
![]() | |
setView (Zend_View_Interface $view) | |
Set the View object. | |
direct () | |
Strategy pattern: currently unutilized. | |
Protected Member Functions | |
_normalizeOptions (array $options=array()) | |
Normalizes given render options. | |
_renderDeepestMenu (Zend_Navigation_Container $container, $ulClass, $indent, $innerIndent, $minDepth, $maxDepth, $ulId, $addPageClassToLi, $activeClass, $parentClass, $renderParentClass) | |
Renders the deepest active menu within [$minDepth, $maxDeth], (called from renderMenu()) | |
_renderMenu (Zend_Navigation_Container $container, $ulClass, $indent, $innerIndent, $minDepth, $maxDepth, $onlyActive, $expandSibs, $ulId, $addPageClassToLi, $activeClass, $parentClass, $renderParentClass) | |
Renders a normal menu (called from renderMenu()) | |
![]() | |
_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. | |
![]() | |
_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 | |
$_ulClass = 'navigation' | |
$_ulId = null | |
$_activeClass = 'active' | |
$_parentClass = 'menu-parent' | |
$_renderParentClass = false | |
$_onlyActiveBranch = false | |
$_renderParents = true | |
$_partial = null | |
$_expandSiblingNodesOfActiveBranch = false | |
$_addPageClassToLi = false | |
$_innerIndent = ' ' | |
![]() | |
$_container | |
$_minDepth | |
$_maxDepth | |
$_indent = '' | |
$_formatOutput = true | |
$_prefixForId = null | |
$_skipPrefixForId = false | |
$_translator | |
$_acl | |
$_renderInvisible = false | |
$_role | |
$_useTranslator = true | |
$_useAcl = true | |
![]() | |
$_closingBracket = null | |
Additional Inherited Members | |
![]() | |
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(). | |
![]() | |
const | EOL = "\n" |
EOL character. | |
![]() | |
static | $_defaultAcl |
static | $_defaultRole |
|
protected |
Normalizes given render options.
array | $options | [optional] options to normalize |
|
protected |
Renders the deepest active menu within [$minDepth, $maxDeth], (called from renderMenu())
Zend_Navigation_Container | $container | container to render |
string | $ulClass | CSS class for first UL |
string | $indent | initial indentation |
string | $innerIndent | inner indentation |
int | null | $minDepth | minimum depth |
int | null | $maxDepth | maximum depth |
string | null | $ulId | unique identifier (id) for first UL |
bool | $addPageClassToLi | adds CSS class from page to li element |
string | null | $activeClass | CSS class for active element |
string | $parentClass | CSS class for parent li's |
bool | $renderParentClass | Render parent class? |
|
protected |
Renders a normal menu (called from renderMenu())
Zend_Navigation_Container | $container | container to render |
string | $ulClass | CSS class for first UL |
string | $indent | initial indentation |
string | $innerIndent | inner indentation |
int | null | $minDepth | minimum depth |
int | null | $maxDepth | maximum depth |
bool | $onlyActive | render only active branch? |
bool | $expandSibs | render siblings of active branch nodes? |
string | null | $ulId | unique identifier (id) for first UL |
bool | $addPageClassToLi | adds CSS class from page to li element |
string | null | $activeClass | CSS class for active element |
string | $parentClass | CSS class for parent li's |
bool | $renderParentClass | Render parent class? |
addPageClassToLi | ( | $flag = true | ) |
Adds CSS class from page to li element.
Before: Bar
After: Bar
bool | $flag | [optional] adds CSS class from page to li element |
getActiveClass | ( | ) |
Returns CSS class to use for the active elements when rendering.
getAddPageClassToLi | ( | ) |
Returns a flag indicating whether the CSS class from page to be added to li element.
getExpandSiblingNodesOfActiveBranch | ( | ) |
Returns a flag indicating whether to expand all sibling nodes of the active branch.
By default, this value is false, meaning the entire menu will be be rendered.
getInnerIndent | ( | ) |
Returns inner indentation (format output is respected)
getOnlyActiveBranch | ( | ) |
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.
getParentClass | ( | ) |
Returns CSS class to use for the parent lie elements when rendering.
getPartial | ( | ) |
Returns partial view script to use for rendering menu.
getRenderParentClass | ( | ) |
Returns flag indicating whether parent class should be rendered to the li element.
getRenderParents | ( | ) |
Returns flag indicating whether parents should be rendered when rendering only the active branch.
By default, this value is true.
getUlClass | ( | ) |
Returns CSS class to use for the first 'ul' element when rendering.
getUlId | ( | ) |
Returns unique identifier (id) to use for the first 'ul' element when rendering.
htmlify | ( | Zend_Navigation_Page | $page | ) |
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().
Zend_Navigation_Page | $page | page to generate HTML for |
menu | ( | Zend_Navigation_Container | $container = null | ) |
View helper entry point: Retrieves helper and optionally sets container to operate on.
Zend_Navigation_Container | $container | [optional] container to operate on |
render | ( | Zend_Navigation_Container | $container = null | ) |
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.
Zend_Navigation_Container | $container | [optional] container to render. Default is to render the container registered in the helper. |
Implements Zend_View_Helper_Navigation_Helper.
renderMenu | ( | Zend_Navigation_Container | $container = null , |
array | $options = array() |
||
) |
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:
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 | ( | Zend_Navigation_Container | $container = null , |
$partial = null |
|||
) |
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. echo 'Number of pages: ', count($this->container);
.
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. |
Zend_View_Exception | When no partial script is set |
renderSubMenu | ( | Zend_Navigation_Container | $container = null , |
$ulClass = null , |
|||
$indent = null , |
|||
$ulId = null , |
|||
$addPageClassToLi = false , |
|||
$innerIndent = null |
|||
) |
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: renderMenu($container, array( 'indent' => $indent, 'ulClass' => $ulClass, 'minDepth' => null, 'maxDepth' => null, 'onlyActiveBranch' => true, 'renderParents' => false ));
Zend_Navigation_Container | $container | [optional] container to render. Default is to render the container registered in the helper. |
string | null | $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(). |
string | null | $ulId | [optional] Unique identifier (id) use for UL element |
bool | $addPageClassToLi | adds CSS class from page to li element |
string | int | $innerIndent | [optional] inner indentation as a string or number of spaces. Default is to use the getInnerIndent(). |
setActiveClass | ( | $activeClass | ) |
Sets CSS class to use for the active elements when rendering.
string | $activeClass | CSS class to set |
setExpandSiblingNodesOfActiveBranch | ( | $flag = true | ) |
Sets a flag indicating whether to expand all sibling nodes of the active branch.
bool | $flag | [optional] expand all siblings of nodes in the active branch. Default is true. |
setInnerIndent | ( | $indent | ) |
Set the inner indentation string for using in render(), optionally a number of spaces to indent with.
string | int | $indent | indentation string or number of spaces |
setOnlyActiveBranch | ( | $flag = true | ) |
Sets a flag indicating whether only active branch should be rendered.
bool | $flag | [optional] render only active branch. Default is true. |
setParentClass | ( | $parentClass | ) |
Sets CSS class to use for the parent li elements when rendering.
string | $parentClass | CSS class to set to parents |
setPartial | ( | $partial | ) |
Sets which partial view script to use for rendering menu.
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. |
setRenderParentClass | ( | $flag = true | ) |
Enables/disables rendering of parent class to the li element.
bool | $flag | [optional] render with parent class. Default is true. |
setRenderParents | ( | $flag = true | ) |
Enables/disables rendering of parents when only rendering active branch.
See setOnlyActiveBranch() for more information.
bool | $flag | [optional] render parents when rendering active branch. Default is true. |
setUlClass | ( | $ulClass | ) |
Sets CSS class to use for the first 'ul' element when rendering.
string | $ulClass | CSS class to set |
setUlId | ( | $ulId | ) |
Sets unique identifier (id) to use for the first 'ul' element when rendering.
string | null | $ulId | Unique identifier (id) to set |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |