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.
Base class for Zend_Navigation_Page pages

string|null
$_accesskey= ''
Accessibility key character
This attribute assigns an access key to an element. An access key is a single character from the document character set.

bool
$_active= 'false'
Whether this page should be considered active
false
Details
string|null
$_fragment= ''
Fragment identifier (anchor identifier)
The fragment identifier (anchor identifier) pointing to an anchor within a resource that is subordinate to another, primary resource. The fragment identifier introduced by a hash mark "#". Example: http://www.example.org/foo.html#bar ("bar" is the fragment identifier)

\Zend_Navigation_Container|null
$_parent= ''
Parent container

array
$_properties= 'array()'
Custom page properties, used by __set(), __get() and __isset()
array()
Details
string|\Zend_Acl_Resource_Interface|null
$_resource= ''
ACL resource associated with this page

__construct(
array|\Zend_Config $options
=
null
)
:
void
Page constructor
Name | Type | Description |
---|---|---|
$options | array|\Zend_Config | [optional] page options. Default is null, which should set defaults. |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if invalid options are given |

__get(
string $name
)
:
mixed
Returns a property, or null if it doesn't exist
Magic overload for enabling
$page->propname
.
Name | Type | Description |
---|---|---|
$name | string | property name |
Type | Description |
---|---|
mixed | property value or null |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if property name is invalid |

__isset(
string $name
)
:
bool
Checks if a property is set
Magic overload for enabling
isset($page->propname)
.
Returns true if the property is native (id, class, title, etc), and true or false if it's a custom property (depending on whether the property actually is set).
Name | Type | Description |
---|---|---|
$name | string | property name |
Type | Description |
---|---|
bool | whether the given property exists |

__set(
string $name, mixed $value
)
:
void
Sets a custom property
Magic overload for enabling
$page->propname = $value
.
Name | Type | Description |
---|---|---|
$name | string | property name |
$value | mixed | value to set |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if property name is invalid |

__toString(
)
:
string
Returns page label
Magic overload for enabling
echo $page
.
Type | Description |
---|---|
string | page label |

__unset(
string $name
)
:
void
Unsets the given custom property
Magic overload for enabling
unset($page->propname)
.
Name | Type | Description |
---|---|---|
$name | string | property name |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if the property is native |

_normalizePropertyName(
string $property
)
:
string
Normalizes a property name
Name | Type | Description |
---|---|---|
$property | string | property name to normalize |
Type | Description |
---|---|
string | normalized property name |

addRel(
string $relation, mixed $value
)
:
\Zend_Navigation_Page
Adds a forward relation to the page
Name | Type | Description |
---|---|---|
$relation | string | relation name (e.g. alternate, glossary, canonical, etc) |
$value | mixed | value to set for relation |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

addRev(
string $relation, mixed $value
)
:
\Zend_Navigation_Page
Adds a reverse relation to the page
Name | Type | Description |
---|---|---|
$relation | string | relation name (e.g. alternate, glossary, canonical, etc) |
$value | mixed | value to set for relation |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

factory(
array|\Zend_Config $options
)
:
\Zend_Navigation_Page
Factory for Zend_Navigation_Page classes
A specific type to construct can be specified by specifying the key 'type' in $options. If type is 'uri' or 'mvc', the type will be resolved to Zend_Navigation_Page_Uri or Zend_Navigation_Page_Mvc. Any other value for 'type' will be considered the full name of the class to construct. A valid custom page class must extend Zend_Navigation_Page.
If 'type' is not given, the type of page to construct will be determined by the following rules: - If $options contains either of the keys 'action', 'controller', 'module', or 'route', a Zend_Navigation_Page_Mvc page will be created. - If $options contains the key 'uri', a Zend_Navigation_Page_Uri page will be created.
Name | Type | Description |
---|---|---|
$options | array|\Zend_Config | options used for creating page |
Type | Description |
---|---|
\Zend_Navigation_Page | a page instance |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if $options is not array/Zend_Config |
\Zend_Exception | if 'type' is specified and Zend_Loader is unable to load the class |
\Zend_Navigation_Exception | if something goes wrong during instantiation of the page |
\Zend_Navigation_Exception | if 'type' is given, and the specified type does not extend this class |
\Zend_Navigation_Exception | if unable to determine which class to instantiate |

get(
string $property
)
:
mixed
Returns the value of the given property
If the given property is native (id, class, title, etc), the matching get method will be used. Otherwise, it will return the matching custom property, or null if not found.
Name | Type | Description |
---|---|---|
$property | string | property name |
Type | Description |
---|---|
mixed | the property's value or null |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if property name is invalid |

getAccesskey(
)
:
string|null
Returns page access key
Type | Description |
---|---|
string|null | page access key or null |

getActive(
bool $recursive
=
false
)
:
bool
Proxy to isActive()
Name | Type | Description |
---|---|---|
$recursive | bool | [optional] whether page should be considered active if any child pages are active. Default is false. |
Type | Description |
---|---|
bool | whether page should be considered active |

getClass(
)
:
string|null
Returns page class (CSS)
Type | Description |
---|---|
string|null | page's CSS class or null |

getCustomProperties(
)
:
array
Returns custom properties as an array
Type | Description |
---|---|
array | an array containing custom properties |

getDefinedRel(
)
:
array
Returns an array containing the defined forward relations
Type | Description |
---|---|
array | defined forward relations |

getDefinedRev(
)
:
array
Returns an array containing the defined reverse relations
Type | Description |
---|---|
array | defined reverse relations |

getFragment(
)
:
string|null
Returns fragment identifier
Type | Description |
---|---|
string|null | fragment identifier |

getHref(
)
:
string
Returns href for this page
Type | Description |
---|---|
string | the page's href |

getOrder(
)
:
int|null
Returns page order used in parent container
Type | Description |
---|---|
int|null | page order or null |

getParent(
)
:
\Zend_Navigation_Container|null
Returns parent container
Type | Description |
---|---|
\Zend_Navigation_Container|null | parent container or null |

getPrivilege(
)
:
string|null
Returns ACL privilege associated with this page
Type | Description |
---|---|
string|null | ACL privilege or null |

getRel(
string $relation
=
null
)
:
array
Returns the page's forward links to other pages
This method returns an associative array of forward links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
Name | Type | Description |
---|---|---|
$relation | string | [optional] name of relation to return. If not given, all relations will be returned. |
Type | Description |
---|---|
array | an array of relations. If $relation is not specified, all relations will be returned in an associative array. |

getResource(
)
:
string|\Zend_Acl_Resource_Interface|null
Returns ACL resource assoicated with this page
Type | Description |
---|---|
string|\Zend_Acl_Resource_Interface|null | ACL resource or null |

getRev(
string $relation
=
null
)
:
array
Returns the page's reverse links to other pages
This method returns an associative array of forward links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
Name | Type | Description |
---|---|---|
$relation | string | [optional] name of relation to return. If not given, all relations will be returned. |
Type | Description |
---|---|
array | an array of relations. If $relation is not specified, all relations will be returned in an associative array. |

getTarget(
)
:
string|null
Returns page target
Type | Description |
---|---|
string|null | page target or null |

getVisible(
bool $recursive
=
false
)
:
bool
Proxy to isVisible()
Returns a boolean value indicating whether the page is visible
Name | Type | Description |
---|---|---|
$recursive | bool | [optional] whether page should be considered invisible if parent is invisible. Default is false. |
Type | Description |
---|---|
bool | whether page should be considered visible |

hashCode(
)
:
string
Returns a hash code value for the page
Type | Description |
---|---|
string | a hash code value for this page |

isActive(
bool $recursive
=
false
)
:
bool
Returns whether page should be considered active or not
Name | Type | Description |
---|---|---|
$recursive | bool | [optional] whether page should be considered active if any child pages are active. Default is false. |
Type | Description |
---|---|
bool | whether page should be considered active |

isVisible(
bool $recursive
=
false
)
:
bool
Returns a boolean value indicating whether the page is visible
Name | Type | Description |
---|---|---|
$recursive | bool | [optional] whether page should be considered invisible if parent is invisible. Default is false. |
Type | Description |
---|---|
bool | whether page should be considered visible |

removeRel(
string $relation
)
:
\Zend_Navigation_Page
Removes a forward relation from the page
Name | Type | Description |
---|---|---|
$relation | string | name of relation to remove |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

removeRev(
string $relation
)
:
\Zend_Navigation_Page
Removes a reverse relation from the page
Name | Type | Description |
---|---|---|
$relation | string | name of relation to remove |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

set(
string $property, mixed $value
)
:
\Zend_Navigation_Page
Sets the given property
If the given property is native (id, class, title, etc), the matching set method will be used. Otherwise, it will be set as a custom property.
Name | Type | Description |
---|---|---|
$property | string | property name |
$value | mixed | value to set |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if property name is invalid |

setAccesskey(
string|null $character
=
null
)
:
\Zend_Navigation_Page
Sets access key for this page
Name | Type | Description |
---|---|---|
$character | string|null | [optional] access key to set. Default is null, which sets no access key. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if access key is not string or null or if the string length not equal to one |

setActive(
bool $active
=
true
)
:
\Zend_Navigation_Page
Sets whether page should be considered active or not
Name | Type | Description |
---|---|---|
$active | bool | [optional] whether page should be considered active or not. Default is true. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

setClass(
string|null $class
=
null
)
:
\Zend_Navigation_Page
Sets page CSS class
Name | Type | Description |
---|---|---|
$class | string|null | [optional] CSS class to set. Default is null, which sets no CSS class. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if not given string or null |

setConfig(
\Zend_Config $config
)
:
\Zend_Navigation_Page
Sets page properties using a Zend_Config object
Name | Type | Description |
---|---|---|
$config | \Zend_Config | config object to get properties from |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if invalid options are given |

setFragment(
string $fragment
)
:
\Zend_Navigation_Page
Sets a fragment identifier
Name | Type | Description |
---|---|---|
$fragment | string | new fragment identifier |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if empty/no string is given |

setId(
string|null $id
=
null
)
:
\Zend_Navigation_Page
Sets page id
Name | Type | Description |
---|---|---|
$id | string|null | [optional] id to set. Default is null, which sets no id. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if not given string or null |

setLabel(
string $label
)
:
\Zend_Navigation_Page
Sets page label
Name | Type | Description |
---|---|---|
$label | string | new page label |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if empty/no string is given |

setOptions(
array $options
)
:
\Zend_Navigation_Page
Sets page properties using options from an associative array
Each key in the array corresponds to the according set*() method, and each word is separated by underscores, e.g. the option 'target' corresponds to setTarget(), and the option 'reset_params' corresponds to the method setResetParams().
Name | Type | Description |
---|---|---|
$options | array | associative array of options to set |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if invalid options are given |

setOrder(
int $order
=
null
)
:
\Zend_Navigation_Page
Sets page order to use in parent container
Name | Type | Description |
---|---|---|
$order | int | [optional] page order in container. Default is null, which sets no specific order. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if order is not integer or null |

setParent(
\Zend_Navigation_Container $parent
=
null
)
:
\Zend_Navigation_Page
Sets parent container
Name | Type | Description |
---|---|---|
$parent | \Zend_Navigation_Container | [optional] new parent to set. Default is null which will set no parent. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

setPrivilege(
string|null $privilege
=
null
)
:
\Zend_Navigation_Page
Sets ACL privilege associated with this page
Name | Type | Description |
---|---|---|
$privilege | string|null | [optional] ACL privilege to associate with this page. Default is null, which sets no privilege. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

setRel(
array|\Zend_Config $relations
=
null
)
:
\Zend_Navigation_Page
Sets the page's forward links to other pages
This method expects an associative array of forward links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
Name | Type | Description |
---|---|---|
$relations | array|\Zend_Config | [optional] an associative array of forward links to other pages |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

setResource(
string|\Zend_Acl_Resource_Interface $resource
=
null
)
:
\Zend_Navigation_Page
Sets ACL resource assoicated with this page
Name | Type | Description |
---|---|---|
$resource | string|\Zend_Acl_Resource_Interface | [optional] resource to associate with page. Default is null, which sets no resource. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if $resource if invalid |

setRev(
array|\Zend_Config $relations
=
null
)
:
\Zend_Navigation_Page
Sets the page's reverse links to other pages
This method expects an associative array of reverse links to other pages, where each element's key is the name of the relation (e.g. alternate, prev, next, help, etc), and the value is a mixed value that could somehow be considered a page.
Name | Type | Description |
---|---|---|
$relations | array|\Zend_Config | [optional] an associative array of reverse links to other pages |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |

setTarget(
string|null $target
=
null
)
:
\Zend_Navigation_Page
Sets page target
Name | Type | Description |
---|---|---|
$target | string|null | [optional] target to set. Default is null, which sets no target. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if target is not string or null |

setTitle(
string $title
=
null
)
:
\Zend_Navigation_Page
Sets page title
Name | Type | Description |
---|---|---|
$title | string | [optional] page title. Default is null, which sets no title. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |
Exception | Description |
---|---|
\Zend_Navigation_Exception | if not given string or null |

setVisible(
bool $visible
=
true
)
:
\Zend_Navigation_Page
Sets whether the page should be visible or not
Name | Type | Description |
---|---|---|
$visible | bool | [optional] whether page should be considered visible or not. Default is true. |
Type | Description |
---|---|
\Zend_Navigation_Page | fluent interface, returns self |