API Documentation

View/Helper/Navigation/HelperAbstract.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_View
subpackage
Helper
version
$Id: HelperAbstract.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_View_Helper_Navigation_HelperAbstract

Description

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.

Zend_View_Helper_Navigation_HelperAbstract

Extends from
Zend_View_Helper_HtmlElement
Implements
Zend_View_Helper_Navigation_Helper
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_View
subpackage
Helper
Properties
$_container
$_minDepth
$_maxDepth
$_indent
$_translator
$_acl
$_renderInvisible
$_role
$_useTranslator
$_useAcl
$_defaultAcl
$_defaultRole
Methods
setContainer
getContainer
setMinDepth
getMinDepth
setMaxDepth
getMaxDepth
setIndent
getIndent
setTranslator
getTranslator
setAcl
getAcl
setRole
getRole
setUseAcl
getUseAcl
getRenderInvisible
setRenderInvisible
setUseTranslator
getUseTranslator
__call
__toString
findActive
hasContainer
hasAcl
hasRole
hasTranslator
htmlify
accept
_acceptAcl
_getWhitespace
_htmlAttribs
_normalizeId
setDefaultAcl
setDefaultRole

Description

Base class for navigational helpers

Properties

$_acl

Zend_Acl $_acl = ''

ACL to use when iterating pages

Details

$_acl
Zend_Acl
visibility
protected
default
final
false
static
false

$_container

Zend_Navigation_Container $_container = ''

Container to operate on by default

Details

$_container
Zend_Navigation_Container
visibility
protected
default
final
false
static
false

$_defaultAcl

Zend_Acl $_defaultAcl = ''

Default ACL to use when iterating pages if not explicitly set in the instance by calling {@link setAcl()}

Details

$_defaultAcl
Zend_Acl
visibility
protected
default
final
false
static
true

$_defaultRole

string|Zend_Acl_Role_Interface $_defaultRole = ''

Default ACL role to use when iterating pages if not explicitly set in the instance by calling {@link setRole()}

Details

$_defaultRole
string|Zend_Acl_Role_Interface
visibility
protected
default
final
false
static
true

$_indent

string $_indent = ''

Indentation string

Details

$_indent
string
visibility
protected
default
final
false
static
false

$_maxDepth

int $_maxDepth = ''

The maximum depth a page can have to be included when rendering

Details

$_maxDepth
int
visibility
protected
default
final
false
static
false

$_minDepth

int $_minDepth = ''

The minimum depth a page must have to be included when rendering

Details

$_minDepth
int
visibility
protected
default
final
false
static
false

$_renderInvisible

bool $_renderInvisible = 'false'

Wheter invisible items should be rendered by this helper

Details

$_renderInvisible
bool
visibility
protected
default
false
final
false
static
false

$_role

string|Zend_Acl_Role_Interface $_role = ''

ACL role to use when iterating pages

Details

$_role
string|Zend_Acl_Role_Interface
visibility
protected
default
final
false
static
false

$_translator

Zend_Translate_Adapter $_translator = ''

Translator

Details

$_translator
Zend_Translate_Adapter
visibility
protected
default
final
false
static
false

$_useAcl

bool $_useAcl = 'true'

Whether ACL should be used for filtering out pages

Details

$_useAcl
bool
visibility
protected
default
true
final
false
static
false

$_useTranslator

bool $_useTranslator = 'true'

Whether translator should be used for page labels and titles

Details

$_useTranslator
bool
visibility
protected
default
true
final
false
static
false

Methods

__call

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

Magic overload: Proxy calls to the navigation container

Arguments
$method
string
method name in container
$arguments
array
[optional] arguments to pass
Output
mixed
returns what the container returns
Details
visibility
public
final
false
static
false
throws
if method does not exist in container

__toString

__toString( ) : string

Magic overload: Proxy to {@link render()}.

This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.

Implements {@link Zend_View_Helper_Navigation_Helper::__toString()}.

Output
string
Details
visibility
public
final
false
static
false

_acceptAcl

_acceptAcl( Zend_Navigation_Page $page ) : bool

Determines whether a page should be accepted by ACL when iterating

Rules: - If helper has no ACL, page is accepted - If page has a resource or privilege defined, page is accepted if the ACL allows access to it using the helper's role - If page has no resource or privilege, page is accepted

Arguments
$page
Zend_Navigation_Page
page to check
Output
bool
whether page is accepted by ACL
Details
visibility
protected
final
false
static
false

_getWhitespace

_getWhitespace( int|string $indent ) : string

Retrieve whitespace representation of $indent

Arguments
$indent
intstring
Output
string
Details
visibility
protected
final
false
static
false

_htmlAttribs

_htmlAttribs( array $attribs ) : string

Converts an associative array to a string of tag attributes.

Overloads {@link Zend_View_Helper_HtmlElement::_htmlAttribs()}.

Arguments
$attribs
array
an array where each key-value pair is converted to an attribute name and value
Output
string
an attribute string
Details
visibility
protected
final
false
static
false

_normalizeId

_normalizeId( string $value ) : string

Normalize an ID

Overrides {@link Zend_View_Helper_HtmlElement::_normalizeId()}.

Arguments
$value
string
Output
string
Details
visibility
protected
final
false
static
false

accept

accept( Zend_Navigation_Page $page, bool $recursive = true ) : bool

Determines whether a page should be accepted when iterating

Rules: - If a page is not visible it is not accepted, unless RenderInvisible has been set to true. - If helper has no ACL, page is accepted - If helper has ACL, but no role, page is not accepted - If helper has ACL and role: - Page is accepted if it has no resource or privilege - Page is accepted if ACL allows page's resource or privilege - If page is accepted by the rules above and $recursive is true, the page will not be accepted if it is the descendant of a non-accepted page.

Arguments
$page
Zend_Navigation_Page
page to check
$recursive
bool
[optional] if true, page will not be accepted if it is the descendant of a page that is not accepted. Default is true.
Output
bool
whether page should be accepted
Details
visibility
public
final
false
static
false

findActive

findActive( Zend_Navigation_Container $container, int|null|int|null $minDepth = null,  $maxDepth = 1 ) : array

Finds the deepest active page in the given container

Arguments
$container
Zend_Navigation_Container
container to search
$minDepth
intnullintnull
[optional] minimum depth required for page to be valid. Default is to use {@link getMinDepth()}. A null value means no minimum depth required.
$maxDepth
Output
array
an associative array with the values 'depth' and 'page', or an empty array if not found
Details
visibility
public
final
false
static
false

getAcl

getAcl( ) : Zend_Acl|null

Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()}

Implements {@link Zend_View_Helper_Navigation_Helper::getAcl()}.

Output
Zend_Acl|null
ACL object or null
Details
visibility
public
final
false
static
false

getContainer

getContainer( ) : Zend_Navigation_Container

Returns the navigation container helper operates on by default

Implements {@link Zend_View_Helper_Navigation_Interface::getContainer()}.

If a helper is not explicitly set in this helper instance by calling {@link setContainer()} or by passing it through the helper entry point, this method will look in {@link Zend_Registry} for a container by using the key 'Zend_Navigation'.

If no container is set, and nothing is found in Zend_Registry, a new container will be instantiated and stored in the helper.

Output
Zend_Navigation_Container
navigation container
Details
visibility
public
final
false
static
false

getIndent

getIndent( ) : string

Returns indentation

Output
string
Details
visibility
public
final
false
static
false

getMaxDepth

getMaxDepth( ) : int|null

Returns maximum depth a page can have to be included when rendering

Output
int|null
maximum depth or null
Details
visibility
public
final
false
static
false

getMinDepth

getMinDepth( ) : int|null

Returns minimum depth a page must have to be included when rendering

Output
int|null
minimum depth or null
Details
visibility
public
final
false
static
false

getRenderInvisible

getRenderInvisible( ) : bool

Return renderInvisible flag

Output
bool
Details
visibility
public
final
false
static
false

getRole

getRole( ) : string|Zend_Acl_Role_Interface|null

Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()}

Implements {@link Zend_View_Helper_Navigation_Helper::getRole()}.

Output
string|Zend_Acl_Role_Interface|null
role or null
Details
visibility
public
final
false
static
false

getTranslator

getTranslator( ) : Zend_Translate_Adapter|null

Returns translator used in helper

Implements {@link Zend_View_Helper_Navigation_Helper::getTranslator()}.

Output
Zend_Translate_Adapter|null
translator or null
Details
visibility
public
final
false
static
false

getUseAcl

getUseAcl( ) : bool

Returns whether ACL should be used

Implements {@link Zend_View_Helper_Navigation_Helper::getUseAcl()}.

Output
bool
whether ACL should be used
Details
visibility
public
final
false
static
false

getUseTranslator

getUseTranslator( ) : bool

Returns whether translator should be used

Implements {@link Zend_View_Helper_Navigation_Helper::getUseTranslator()}.

Output
bool
whether translator should be used
Details
visibility
public
final
false
static
false

hasAcl

hasAcl( ) : bool

Checks if the helper has an ACL instance

Implements {@link Zend_View_Helper_Navigation_Helper::hasAcl()}.

Output
bool
whether the helper has a an ACL instance or not
Details
visibility
public
final
false
static
false

hasContainer

hasContainer( ) : bool

Checks if the helper has a container

Implements {@link Zend_View_Helper_Navigation_Helper::hasContainer()}.

Output
bool
whether the helper has a container or not
Details
visibility
public
final
false
static
false

hasRole

hasRole( ) : bool

Checks if the helper has an ACL role

Implements {@link Zend_View_Helper_Navigation_Helper::hasRole()}.

Output
bool
whether the helper has a an ACL role or not
Details
visibility
public
final
false
static
false

hasTranslator

hasTranslator( ) : bool

Checks if the helper has a translator

Implements {@link Zend_View_Helper_Navigation_Helper::hasTranslator()}.

Output
bool
whether the helper has a translator or not
Details
visibility
public
final
false
static
false

htmlify

htmlify( Zend_Navigation_Page $page ) : string

Returns an HTML string containing an 'a' element for the given page

Arguments
$page
Zend_Navigation_Page
page to generate HTML for
Output
string
HTML string for the given page
Details
visibility
public
final
false
static
false

setAcl

setAcl( Zend_Acl $acl = null ) : Zend_View_Helper_Navigation_HelperAbstract

Sets ACL to use when iterating pages

Implements {@link Zend_View_Helper_Navigation_Helper::setAcl()}.

Arguments
$acl
Zend_Acl
[optional] ACL object. Default is null.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false

setContainer

setContainer( Zend_Navigation_Container $container = null ) : Zend_View_Helper_Navigation_HelperAbstract

Sets navigation container the helper operates on by default

Implements {@link Zend_View_Helper_Navigation_Interface::setContainer()}.

Arguments
$container
Zend_Navigation_Container
[optional] container to operate on. Default is null, meaning container will be reset.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false

setDefaultAcl

setDefaultAcl( Zend_Acl $acl = null ) : void

Sets default ACL to use if another ACL is not explicitly set

Arguments
$acl
Zend_Acl
[optional] ACL object. Default is null, which sets no ACL object.
Details
visibility
public
final
false
static
true

setDefaultRole

setDefaultRole( midex $role = null ) : void

Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()}

Arguments
$role
midex
[optional] role to set. Expects null, string, or an instance of {@link Zend_Acl_Role_Interface}. Default is null, which sets no default role.
Details
visibility
public
final
false
static
true
throws
if role is invalid

setIndent

setIndent( string|int $indent ) : Zend_View_Helper_Navigation_HelperAbstract

Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with

Arguments
$indent
stringint
indentation string or number of spaces
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false

setMaxDepth

setMaxDepth( int $maxDepth = null ) : Zend_View_Helper_Navigation_HelperAbstract

Sets the maximum depth a page can have to be included when rendering

Arguments
$maxDepth
int
[optional] maximum depth. Default is null, which sets no maximum depth.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false

setMinDepth

setMinDepth( int $minDepth = null ) : Zend_View_Helper_Navigation_HelperAbstract

Sets the minimum depth a page must have to be included when rendering

Arguments
$minDepth
int
[optional] minimum depth. Default is null, which sets no minimum depth.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false

setRenderInvisible

setRenderInvisible( bool $renderInvisible = true ) : Zend_View_Helper_Navigation_HelperAbstract

Render invisible items?

Arguments
$renderInvisible
bool
[optional] boolean flag
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface returns self
Details
visibility
public
final
false
static
false

setRole

setRole( mixed $role = null ) : Zend_View_Helper_Navigation_HelperAbstract

Sets ACL role(s) to use when iterating pages

Implements {@link Zend_View_Helper_Navigation_Helper::setRole()}.

Arguments
$role
mixed
[optional] role to set. Expects a string, an instance of type {@link Zend_Acl_Role_Interface}, or null. Default is null, which will set no role.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if $role is invalid

setTranslator

setTranslator( mixed $translator = null ) : Zend_View_Helper_Navigation_HelperAbstract

Sets translator to use in helper

Implements {@link Zend_View_Helper_Navigation_Helper::setTranslator()}.

Arguments
$translator
mixed
[optional] translator. Expects an object of type {@link Zend_Translate_Adapter} or {@link Zend_Translate}, or null. Default is null, which sets no translator.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false

setUseAcl

setUseAcl( bool $useAcl = true ) : Zend_View_Helper_Navigation_HelperAbstract

Sets whether ACL should be used

Implements {@link Zend_View_Helper_Navigation_Helper::setUseAcl()}.

Arguments
$useAcl
bool
[optional] whether ACL should be used. Default is true.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false

setUseTranslator

setUseTranslator( bool $useTranslator = true ) : Zend_View_Helper_Navigation_HelperAbstract

Sets whether translator should be used

Implements {@link Zend_View_Helper_Navigation_Helper::setUseTranslator()}.

Arguments
$useTranslator
bool
[optional] whether translator should be used. Default is true.
Output
Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.