Zend Framework
1.12
|
Public Member Functions | |
__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. | |
![]() | |
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 | factory ($options) |
Factory for Zend_Navigation_Page classes. | |
static | setDefaultPageType ($type=null) |
static | getDefaultPageType () |
Protected Member Functions | |
_init () | |
Initializes page (used by subclasses) | |
![]() | |
_sort () | |
Sorts the page index according to page order. | |
Static Protected Member Functions | |
static | _normalizePropertyName ($property) |
Normalizes a property name. | |
Protected Attributes | |
$_label | |
$_fragment | |
$_id | |
$_class | |
$_title | |
$_target | |
$_accesskey | |
$_rel = array() | |
$_rev = array() | |
$_order | |
$_resource | |
$_privilege | |
$_active = false | |
$_visible = true | |
$_parent | |
$_properties = array() | |
$_customHtmlAttribs = array() | |
![]() | |
$_pages = array() | |
$_index = array() | |
$_dirtyIndex = false | |
Static Protected Attributes | |
static | $_defaultPageType |
__construct | ( | $options = null | ) |
Page constructor.
array | Zend_Config | $options | [optional] page options. Default is null, which should set defaults. |
Zend_Navigation_Exception | if invalid options are given |
__get | ( | $name | ) |
Returns a property, or null if it doesn't exist.
Magic overload for enabling $page->propname
.
string | $name | property name |
Zend_Navigation_Exception | if property name is invalid |
__isset | ( | $name | ) |
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).
string | $name | property name |
__set | ( | $name, | |
$value | |||
) |
Sets a custom property.
Magic overload for enabling $page->propname = $value
.
string | $name | property name |
mixed | $value | value to set |
Zend_Navigation_Exception | if property name is invalid |
__toString | ( | ) |
Returns page label.
Magic overload for enabling echo $page
.
__unset | ( | $name | ) |
Unsets the given custom property.
Magic overload for enabling unset($page->propname)
.
string | $name | property name |
Zend_Navigation_Exception | if the property is native |
|
protected |
Initializes page (used by subclasses)
|
staticprotected |
Normalizes a property name.
string | $property | property name to normalize |
addRel | ( | $relation, | |
$value | |||
) |
Adds a forward relation to the page.
string | $relation | relation name (e.g. alternate, glossary, canonical, etc) |
mixed | $value | value to set for relation |
addRev | ( | $relation, | |
$value | |||
) |
Adds a reverse relation to the page.
string | $relation | relation name (e.g. alternate, glossary, canonical, etc) |
mixed | $value | value to set for relation |
clearCustomHtmlAttribs | ( | ) |
Clear all custom HTML attributes.
|
static |
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:
array | Zend_Config | $options | options used for creating page |
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 | ( | $property | ) |
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.
string | $property | property name |
Zend_Navigation_Exception | if property name is invalid |
getAccesskey | ( | ) |
Returns page access key.
getActive | ( | $recursive = false | ) |
Proxy to isActive()
bool | $recursive | [optional] whether page should be considered active if any child pages are active. Default is false. |
getClass | ( | ) |
Returns page class (CSS)
getCustomHtmlAttrib | ( | $name | ) |
Returns a single custom HTML attributes by name.
string | $name | name of the HTML attribute |
Zend_Navigation_Exception | if name is not string |
getCustomHtmlAttribs | ( | ) |
Returns all custom HTML attributes as an array.
getCustomProperties | ( | ) |
Returns custom properties as an array.
|
static |
getDefinedRel | ( | ) |
Returns an array containing the defined forward relations.
getDefinedRev | ( | ) |
Returns an array containing the defined reverse relations.
getFragment | ( | ) |
Returns fragment identifier.
|
abstract |
Returns href for this page.
getId | ( | ) |
Returns page id.
getLabel | ( | ) |
Returns page label.
getOrder | ( | ) |
Returns page order used in parent container.
getParent | ( | ) |
Returns parent container.
getPrivilege | ( | ) |
Returns ACL privilege associated with this page.
getRel | ( | $relation = null | ) |
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.
string | $relation | [optional] name of relation to return. If not given, all relations will be returned. |
getResource | ( | ) |
Returns ACL resource assoicated with this page.
getRev | ( | $relation = null | ) |
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.
string | $relation | [optional] name of relation to return. If not given, all relations will be returned. |
getTarget | ( | ) |
Returns page target.
getTitle | ( | ) |
Returns page title.
getVisible | ( | $recursive = false | ) |
Proxy to isVisible()
Returns a boolean value indicating whether the page is visible
bool | $recursive | [optional] whether page should be considered invisible if parent is invisible. Default is false. |
|
final |
Returns a hash code value for the page.
isActive | ( | $recursive = false | ) |
Returns whether page should be considered active or not.
bool | $recursive | [optional] whether page should be considered active if any child pages are active. Default is false. |
isVisible | ( | $recursive = false | ) |
Returns a boolean value indicating whether the page is visible.
bool | $recursive | [optional] whether page should be considered invisible if parent is invisible. Default is false. |
removeCustomHtmlAttrib | ( | $name | ) |
Removes a custom HTML attribute from the page.
string | $name | name of the custom HTML attribute |
removeRel | ( | $relation | ) |
Removes a forward relation from the page.
string | $relation | name of relation to remove |
removeRev | ( | $relation | ) |
Removes a reverse relation from the page.
string | $relation | name of relation to remove |
set | ( | $property, | |
$value | |||
) |
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.
string | $property | property name |
mixed | $value | value to set |
Zend_Navigation_Exception | if property name is invalid |
setAccesskey | ( | $character = null | ) |
Sets access key for this page.
string | null | $character | [optional] access key to set. Default is null, which sets no access key. |
Zend_Navigation_Exception | if access key is not string or null or if the string length not equal to one |
setActive | ( | $active = true | ) |
Sets whether page should be considered active or not.
bool | $active | [optional] whether page should be considered active or not. Default is true. |
setClass | ( | $class = null | ) |
Sets page CSS class.
string | null | $class | [optional] CSS class to set. Default is null, which sets no CSS class. |
Zend_Navigation_Exception | if not given string or null |
setConfig | ( | Zend_Config | $config | ) |
Sets page properties using a Zend_Config object.
Zend_Config | $config | config object to get properties from |
Zend_Navigation_Exception | if invalid options are given |
setCustomHtmlAttrib | ( | $name, | |
$value | |||
) |
Sets a single custom HTML attribute.
string | $name | name of the HTML attribute |
string | null | $value | value for the HTML attribute |
Zend_Navigation_Exception | if name is not string or value is not null or a string |
setCustomHtmlAttribs | ( | array | $attribs | ) |
Sets multiple custom HTML attributes at once.
array | $attribs | an associative array of html attributes |
|
static |
setFragment | ( | $fragment | ) |
Sets a fragment identifier.
string | $fragment | new fragment identifier |
Zend_Navigation_Exception | if empty/no string is given |
setId | ( | $id = null | ) |
Sets page id.
string | null | $id | [optional] id to set. Default is null, which sets no id. |
Zend_Navigation_Exception | if not given string or null |
setLabel | ( | $label | ) |
Sets page label.
string | $label | new page label |
Zend_Navigation_Exception | if empty/no string is given |
setOptions | ( | array | $options | ) |
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().
array | $options | associative array of options to set |
Zend_Navigation_Exception | if invalid options are given |
setOrder | ( | $order = null | ) |
Sets page order to use in parent container.
int | $order | [optional] page order in container. Default is null, which sets no specific order. |
Zend_Navigation_Exception | if order is not integer or null |
setParent | ( | Zend_Navigation_Container | $parent = null | ) |
Sets parent container.
Zend_Navigation_Container | $parent | [optional] new parent to set. Default is null which will set no parent. |
setPrivilege | ( | $privilege = null | ) |
Sets ACL privilege associated with this page.
string | null | $privilege | [optional] ACL privilege to associate with this page. Default is null, which sets no privilege. |
setRel | ( | $relations = null | ) |
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.
array | Zend_Config | $relations | [optional] an associative array of forward links to other pages |
setResource | ( | $resource = null | ) |
Sets ACL resource assoicated with this page.
string | Zend_Acl_Resource_Interface | $resource | [optional] resource to associate with page. Default is null, which sets no resource. |
Zend_Navigation_Exception | if $resource if invalid |
setRev | ( | $relations = null | ) |
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.
array | Zend_Config | $relations | [optional] an associative array of reverse links to other pages |
setTarget | ( | $target = null | ) |
Sets page target.
string | null | $target | [optional] target to set. Default is null, which sets no target. |
Zend_Navigation_Exception | if target is not string or null |
setTitle | ( | $title = null | ) |
Sets page title.
string | $title | [optional] page title. Default is null, which sets no title. |
Zend_Navigation_Exception | if not given string or null |
setVisible | ( | $visible = true | ) |
Sets whether the page should be visible or not.
bool | $visible | [optional] whether page should be considered visible or not. Default is true. |
toArray | ( | ) |
Returns an array representation of the page.
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |