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

Public Member Functions

 isActive ($recursive=false)
 Returns whether page should be considered active or not.
 
 getHref ()
 Returns href for this page.
 
 setAction ($action)
 Sets action name to use when assembling URL.
 
 getAction ()
 Returns action name to use when assembling URL.
 
 setController ($controller)
 Sets controller name to use when assembling URL.
 
 getController ()
 Returns controller name to use when assembling URL.
 
 setModule ($module)
 Sets module name to use when assembling URL.
 
 getModule ()
 Returns module name to use when assembling URL.
 
 setParams (array $params=null)
 Set multiple parameters (to use when assembling URL) at once.
 
 setParam ($name, $value)
 Set parameter (to use when assembling URL)
 
 addParams (array $params)
 Add multiple parameters (to use when assembling URL) at once.
 
 removeParam ($name)
 Remove parameter (to use when assembling URL)
 
 clearParams ()
 Clear all parameters (to use when assembling URL)
 
 getParams ()
 Retrieve all parameters (to use when assembling URL)
 
 getParam ($name)
 Retrieve a single parameter (to use when assembling URL)
 
 setRoute ($route)
 Sets route name to use when assembling URL.
 
 getRoute ()
 Returns route name to use when assembling URL.
 
 setResetParams ($resetParams)
 Sets whether params should be reset when assembling URL.
 
 getResetParams ()
 Returns whether params should be reset when assembling URL.
 
 setEncodeUrl ($encodeUrl)
 Sets whether href should be encoded when assembling URL.
 
 getEncodeUrl ()
 Returns whether herf should be encoded when assembling URL.
 
 setScheme ($scheme)
 Sets scheme to use when assembling URL.
 
 getScheme ()
 Returns scheme to use when assembling URL.
 
 toArray ()
 Returns an array representation of the page.
 
- Public Member Functions inherited from Zend_Navigation_Page
 __construct ($options=null)
 Page constructor.
 
 setConfig (Zend_Config $config)
 Sets page properties using a Zend_Config object.
 
 setOptions (array $options)
 Sets page properties using options from an associative array.
 
 setLabel ($label)
 Sets page label.
 
 getLabel ()
 Returns page label.
 
 setFragment ($fragment)
 Sets a fragment identifier.
 
 getFragment ()
 Returns fragment identifier.
 
 setId ($id=null)
 Sets page id.
 
 getId ()
 Returns page id.
 
 setClass ($class=null)
 Sets page CSS class.
 
 getClass ()
 Returns page class (CSS)
 
 setTitle ($title=null)
 Sets page title.
 
 getTitle ()
 Returns page title.
 
 setTarget ($target=null)
 Sets page target.
 
 getTarget ()
 Returns page target.
 
 setAccesskey ($character=null)
 Sets access key for this page.
 
 getAccesskey ()
 Returns page access key.
 
 setRel ($relations=null)
 Sets the page's forward links to other pages.
 
 getRel ($relation=null)
 Returns the page's forward links to other pages.
 
 setRev ($relations=null)
 Sets the page's reverse links to other pages.
 
 getRev ($relation=null)
 Returns the page's reverse links to other pages.
 
 setCustomHtmlAttrib ($name, $value)
 Sets a single custom HTML attribute.
 
 getCustomHtmlAttrib ($name)
 Returns a single custom HTML attributes by name.
 
 setCustomHtmlAttribs (array $attribs)
 Sets multiple custom HTML attributes at once.
 
 getCustomHtmlAttribs ()
 Returns all custom HTML attributes as an array.
 
 removeCustomHtmlAttrib ($name)
 Removes a custom HTML attribute from the page.
 
 clearCustomHtmlAttribs ()
 Clear all custom HTML attributes.
 
 setOrder ($order=null)
 Sets page order to use in parent container.
 
 getOrder ()
 Returns page order used in parent container.
 
 setResource ($resource=null)
 Sets ACL resource assoicated with this page.
 
 getResource ()
 Returns ACL resource assoicated with this page.
 
 setPrivilege ($privilege=null)
 Sets ACL privilege associated with this page.
 
 getPrivilege ()
 Returns ACL privilege associated with this page.
 
 setActive ($active=true)
 Sets whether page should be considered active or not.
 
 isActive ($recursive=false)
 Returns whether page should be considered active or not.
 
 getActive ($recursive=false)
 Proxy to isActive()
 
 setVisible ($visible=true)
 Sets whether the page should be visible or not.
 
 isVisible ($recursive=false)
 Returns a boolean value indicating whether the page is visible.
 
 getVisible ($recursive=false)
 Proxy to isVisible()
 
 setParent (Zend_Navigation_Container $parent=null)
 Sets parent container.
 
 getParent ()
 Returns parent container.
 
 set ($property, $value)
 Sets the given property.
 
 get ($property)
 Returns the value of the given property.
 
 __set ($name, $value)
 Sets a custom property.
 
 __get ($name)
 Returns a property, or null if it doesn't exist.
 
 __isset ($name)
 Checks if a property is set.
 
 __unset ($name)
 Unsets the given custom property.
 
 __toString ()
 Returns page label.
 
 addRel ($relation, $value)
 Adds a forward relation to the page.
 
 addRev ($relation, $value)
 Adds a reverse relation to the page.
 
 removeRel ($relation)
 Removes a forward relation from the page.
 
 removeRev ($relation)
 Removes a reverse relation from the page.
 
 getDefinedRel ()
 Returns an array containing the defined forward relations.
 
 getDefinedRev ()
 Returns an array containing the defined reverse relations.
 
 getCustomProperties ()
 Returns custom properties as an array.
 
 hashCode ()
 Returns a hash code value for the page.
 
 toArray ()
 Returns an array representation of the page.
 
 getHref ()
 Returns href for this page.
 
- Public Member Functions inherited from Zend_Navigation_Container
 notifyOrderUpdated ()
 Notifies container that the order of pages are updated.
 
 addPage ($page)
 Adds a page to the container.
 
 addPages ($pages)
 Adds several pages at once.
 
 setPages (array $pages)
 Sets pages this container should have, removing existing pages.
 
 getPages ()
 Returns pages in the container.
 
 removePage ($page)
 Removes the given page from the container.
 
 removePages ()
 Removes all pages in container.
 
 hasPage (Zend_Navigation_Page $page, $recursive=false)
 Checks if the container has the given page.
 
 hasPages ()
 Returns true if container contains any pages.
 
 findOneBy ($property, $value, $useRegex=false)
 Returns a child page matching $property == $value or preg_match($value, $property), or null if not found.
 
 findAllBy ($property, $value, $useRegex=false)
 Returns all child pages matching $property == $value or preg_match($value, $property), or an empty array if no pages are found.
 
 findBy ($property, $value, $all=false, $useRegex=false)
 Returns page(s) matching $property == $value or preg_match($value, $property)
 
 __call ($method, $arguments)
 Magic overload: Proxy calls to finder methods.
 
 toArray ()
 Returns an array representation of all pages in container.
 
 current ()
 Returns current page.
 
 key ()
 Returns hash code of current page.
 
 next ()
 Moves index pointer to next page in the container.
 
 rewind ()
 Sets index pointer to first page in the container.
 
 valid ()
 Checks if container index is valid.
 
 hasChildren ()
 Proxy to hasPages()
 
 getChildren ()
 Returns the child container.
 
 count ()
 Returns number of pages in container.
 

Static Public Member Functions

static setUrlHelper (Zend_Controller_Action_Helper_Url $uh)
 Sets action helper for assembling URLs.
 
static setSchemeHelper (Zend_View_Helper_ServerUrl $sh)
 Sets view helper for assembling URLs with schemes.
 
- Static Public Member Functions inherited from Zend_Navigation_Page
static factory ($options)
 Factory for Zend_Navigation_Page classes.
 
static setDefaultPageType ($type=null)
 
static getDefaultPageType ()
 

Protected Attributes

 $_action
 
 $_controller
 
 $_module
 
 $_params = array()
 
 $_route
 
 $_resetParams = true
 
 $_encodeUrl = true
 
 $_active = null
 
 $_scheme
 
 $_hrefCache
 
- Protected Attributes inherited from Zend_Navigation_Page
 $_label
 
 $_fragment
 
 $_id
 
 $_class
 
 $_title
 
 $_target
 
 $_accesskey
 
 $_rel = array()
 
 $_rev = array()
 
 $_order
 
 $_resource
 
 $_privilege
 
 $_active = false
 
 $_visible = true
 
 $_parent
 
 $_properties = array()
 
 $_customHtmlAttribs = array()
 
- Protected Attributes inherited from Zend_Navigation_Container
 $_pages = array()
 
 $_index = array()
 
 $_dirtyIndex = false
 

Static Protected Attributes

static $_urlHelper = null
 
static $_schemeHelper = null
 
- Static Protected Attributes inherited from Zend_Navigation_Page
static $_defaultPageType
 

Additional Inherited Members

- Protected Member Functions inherited from Zend_Navigation_Page
 _init ()
 Initializes page (used by subclasses)
 
- Static Protected Member Functions inherited from Zend_Navigation_Page
static _normalizePropertyName ($property)
 Normalizes a property name.
 

Member Function Documentation

addParams ( array  $params)

Add multiple parameters (to use when assembling URL) at once.

URL options passed to the url action helper for assembling URLs.

See Also
getHref()
Parameters
array$paramsparamters as array ('name' => 'value')
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
clearParams ( )

Clear all parameters (to use when assembling URL)

See Also
getHref()
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
getAction ( )

Returns action name to use when assembling URL.

See Also
getHref()
Returns
string|null action name
getController ( )

Returns controller name to use when assembling URL.

See Also
getHref()
Returns
string|null controller name or null
getEncodeUrl ( )

Returns whether herf should be encoded when assembling URL.

See Also
getHref()
Returns
bool whether herf should be encoded when assembling URL
getHref ( )

Returns href for this page.

This method uses Zend_Controller_Action_Helper_Url to assemble the href based on the page's properties.

Returns
string page href
getModule ( )

Returns module name to use when assembling URL.

See Also
getHref()
Returns
string|null module name or null
getParam (   $name)

Retrieve a single parameter (to use when assembling URL)

See Also
getHref()
Parameters
string$nameparameter name
Returns
mixed
getParams ( )

Retrieve all parameters (to use when assembling URL)

See Also
getHref()
Returns
array parameters as array ('name' => 'value')
getResetParams ( )

Returns whether params should be reset when assembling URL.

See Also
getHref()
Returns
bool whether params should be reset when assembling URL
getRoute ( )

Returns route name to use when assembling URL.

See Also
getHref()
Returns
string route name
getScheme ( )

Returns scheme to use when assembling URL.

See Also
getHref()
Returns
string|null scheme or null
isActive (   $recursive = false)

Returns whether page should be considered active or not.

This method will compare the page properties against the request object that is found in the front controller.

Parameters
bool$recursive[optional] whether page should be considered active if any child pages are active. Default is false.
Returns
bool whether page should be considered active or not
removeParam (   $name)

Remove parameter (to use when assembling URL)

See Also
getHref()
Parameters
string$name
Returns
bool
setAction (   $action)

Sets action name to use when assembling URL.

See Also
getHref()
Parameters
string$actionaction name
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
Exceptions
Zend_Navigation_Exceptionif invalid $action is given
setController (   $controller)

Sets controller name to use when assembling URL.

See Also
getHref()
Parameters
string | null$controllercontroller name
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
Exceptions
Zend_Navigation_Exceptionif invalid controller name is given
setEncodeUrl (   $encodeUrl)

Sets whether href should be encoded when assembling URL.

See Also
getHref()
Parameters
$encodeUrl
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
setModule (   $module)

Sets module name to use when assembling URL.

See Also
getHref()
Parameters
string | null$modulemodule name
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
Exceptions
Zend_Navigation_Exceptionif invalid module name is given
setParam (   $name,
  $value 
)

Set parameter (to use when assembling URL)

URL option passed to the url action helper for assembling URLs.

See Also
getHref()
Parameters
string$nameparameter name
mixed$valueparameter value
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
setParams ( array  $params = null)

Set multiple parameters (to use when assembling URL) at once.

URL options passed to the url action helper for assembling URLs. Overwrites any previously set parameters!

See Also
getHref()
Parameters
array | null$params[optional] paramters as array ('name' => 'value'). Default is null which clears all params.
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
setResetParams (   $resetParams)

Sets whether params should be reset when assembling URL.

See Also
getHref()
Parameters
bool$resetParamswhether params should be reset when assembling URL
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
setRoute (   $route)

Sets route name to use when assembling URL.

See Also
getHref()
Parameters
string$routeroute name to use when assembling URL
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
Exceptions
Zend_Navigation_Exceptionif invalid $route is given
setScheme (   $scheme)

Sets scheme to use when assembling URL.

See Also
getHref()
Parameters
string | null$schemescheme
Exceptions
Zend_Navigation_Exception
Returns
Zend_Navigation_Page_Mvc fluent interface, returns self
static setSchemeHelper ( Zend_View_Helper_ServerUrl  $sh)
static

Sets view helper for assembling URLs with schemes.

See Also
getHref()
Parameters
Zend_View_Helper_ServerUrl$shscheme helper
Returns
void
static setUrlHelper ( Zend_Controller_Action_Helper_Url  $uh)
static

Sets action helper for assembling URLs.

See Also
getHref()
Parameters
Zend_Controller_Action_Helper_Url$uhURL helper
Returns
void
toArray ( )

Returns an array representation of the page.

Returns
array associative array containing all page properties

Member Data Documentation

$_action
protected
$_active = null
protected
$_controller
protected
$_encodeUrl = true
protected
$_hrefCache
protected
$_module
protected
$_params = array()
protected
$_resetParams = true
protected
$_route
protected
$_scheme
protected
$_schemeHelper = null
staticprotected
$_urlHelper = null
staticprotected