Represents a page that is defined using module, controller, action, route name and route params to assemble the href
Container class for Zend_Navigation_Page classes.
category | Zend |
---|---|
package | Zend_Navigation |
subpackage | Page |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Navigation_Page |
__call(string $method, array $arguments) : mixed
Examples of finder calls:
// METHOD // SAME AS
$nav->findByLabel('foo'); // $nav->findOneBy('label', 'foo');
$nav->findByLabel('/foo/', true); // $nav->findBy('label', '/foo/', true);
$nav->findOneByLabel('foo'); // $nav->findOneBy('label', 'foo');
$nav->findAllByClass('foo'); // $nav->findAllBy('class', 'foo');
string
method name
array
method arguments
\Zend_Navigation_Exception |
if method does not exist |
---|
mixed
Zend_Navigation|array|null matching page, array of pages
or null__construct(array|\Zend_Config $options = null
)
array
\Zend_Config
[optional] page options. Default is null, which should set defaults.
\Zend_Navigation_Exception |
if invalid options are given |
---|
__get(string $name) : mixed
Magic overload for enabling $page->propname
.
string
property name
\Zend_Navigation_Exception |
if property name is invalid |
---|
mixed
property value or null__isset(string $name) : boolean
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
property name
boolean
whether the given property exists__set(string $name, mixed $value) : void
Magic overload for enabling $page->propname = $value
.
string
property name
mixed
value to set
\Zend_Navigation_Exception |
if property name is invalid |
---|
__toString() : string
Magic overload for enabling echo $page
.
string
page label__unset(string $name) : void
Magic overload for enabling unset($page->propname)
.
string
property name
\Zend_Navigation_Exception |
if the property is native |
---|
addPage(\Zend_Navigation_Page|array|\Zend_Config $page) : \Zend_Navigation_Container
This method will inject the container as the given page's parent by calling Zend_Navigation_Page::setParent().
\Zend_Navigation_Page
array
\Zend_Config
page to add
\Zend_Navigation_Exception |
if page is invalid |
---|
\Zend_Navigation_Container
fluent interface,
returns selfaddPages(array<mixed,\Zend_Navigation_Page>|\Zend_Config|\Zend_Navigation_Container $pages) : \Zend_Navigation_Container
array<mixed,\Zend_Navigation_Page>
\Zend_Config
\Zend_Navigation_Container
pages to add
\Zend_Navigation_Exception |
if $pages is not array, Zend_Config or Zend_Navigation_Container |
---|
\Zend_Navigation_Container
fluent interface,
returns selfaddParams(array $params) : \Zend_Navigation_Page_Mvc
addRel(string $relation, mixed $value) : \Zend_Navigation_Page
string
relation name (e.g. alternate, glossary, canonical, etc)
mixed
value to set for relation
\Zend_Navigation_Page
fluent interface, returns selfaddRev(string $relation, mixed $value) : \Zend_Navigation_Page
string
relation name (e.g. alternate, glossary, canonical, etc)
mixed
value to set for relation
\Zend_Navigation_Page
fluent interface, returns selfclearCustomHtmlAttribs() : \Zend_Navigation_Page
\Zend_Navigation_Page
fluent interface, returns selfclearParams() : \Zend_Navigation_Page_Mvc
count() : integer
Implements Countable interface.
integer
number of pages in the containercurrent() : \Zend_Navigation_Page
Implements RecursiveIterator interface.
\Zend_Navigation_Exception |
if the index is invalid |
---|
\Zend_Navigation_Page
current page or nullfactory(array|\Zend_Config $options) : \Zend_Navigation_Page
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 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 |
\Zend_Navigation_Page
a page instancefindAllBy(string $property, mixed $value, boolean $useRegex = false
) : array<mixed,\Zend_Navigation_Page>
string
name of property to match against
mixed
value to match property against
boolean
[optional] if true PHP's preg_match is used. Default is false.
array<mixed,\Zend_Navigation_Page>
array containing only Zend_Navigation_Page
instancesfindBy(string $property, mixed $value, boolean $all= false
, boolean $useRegex= false
) : \Zend_Navigation_Page | null
string
name of property to match against
mixed
value to match property against
boolean
[optional] whether an array of all matching pages should be returned, or only the first. If true, an array will be returned, even if not matching pages are found. If false, null will be returned if no matching page is found. Default is false.
boolean
[optional] if true PHP's preg_match is used. Default is false.
\Zend_Navigation_Page
null
matching page or nullfindOneBy(string $property, mixed $value, boolean $useRegex = false
) : \Zend_Navigation_Page | null
string
name of property to match against
mixed
value to match property against
boolean
[optional] if true PHP's preg_match is used. Default is false.
\Zend_Navigation_Page
null
matching page or nullget(string $property) : mixed
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 name
\Zend_Navigation_Exception |
if property name is invalid |
---|
mixed
the property's value or nullgetAccesskey() : string | null
string
null
page access key or nullgetAction() : string | null
getActive(boolean $recursive = false
) : boolean
boolean
[optional] whether page should be considered active if any child pages are active. Default is false.
boolean
whether page should be considered activegetChildren() : \Zend_Navigation_Page | null
Implements RecursiveIterator interface.
\Zend_Navigation_Page
null
getClass() : string | null
string
null
page's CSS class or nullgetController() : string | null
getCustomHtmlAttrib(string $name) : string | null
string
name of the HTML attribute
\Zend_Navigation_Exception |
if name is not string |
---|
string
null
value for the HTML attribute or nullgetCustomHtmlAttribs() : array
array
an array containing custom HTML attributesgetCustomProperties() : array
array
an array containing custom propertiesgetDefaultPageType()
getDefinedRel() : array
array
defined forward relationsgetDefinedRev() : array
array
defined reverse relationsgetEncodeUrl() : boolean
getFragment() : string | null
string
null
fragment identifiergetHref() : string
This method uses Zend_Controller_Action_Helper_Url to assemble the href based on the page's properties.
inherited_from | \Zend_Navigation_Page::getHref() |
---|
string
page hrefgetHref() : string
string
the page's hrefgetId() : string | null
string
null
page id or nullgetLabel() : string
string
page label or nullgetModule() : string | null
getOrder() : integer | null
integer
null
page order or nullgetPages() : array<mixed,\Zend_Navigation_Page>
array<mixed,\Zend_Navigation_Page>
array of Zend_Navigation_Page instancesgetParam(string $name) : mixed
getParams() : array
getParent() : \Zend_Navigation_Container | null
\Zend_Navigation_Container
null
parent container or nullgetPrivilege() : string | null
string
null
ACL privilege or nullgetRel(string $relation = null
) : array
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
[optional] name of relation to return. If not given, all relations will be returned.
array
an array of relations. If $relation is not
specified, all relations will be returned in
an associative array.getResetParams() : boolean
getResource() : string | \Zend_Acl_Resource_Interface | null
string
\Zend_Acl_Resource_Interface
null
ACL resource or nullgetRev(string $relation = null
) : array
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
[optional] name of relation to return. If not given, all relations will be returned.
array
an array of relations. If $relation is not
specified, all relations will be returned in
an associative array.getScheme() : string | null
getTarget() : string | null
string
null
page target or nullgetTitle() : string | null
string
null
page title or nullgetVisible(boolean $recursive = false
) : boolean
Returns a boolean value indicating whether the page is visible
boolean
[optional] whether page should be considered invisible if parent is invisible. Default is false.
boolean
whether page should be considered visiblehasChildren() : boolean
Implements RecursiveIterator interface.
boolean
whether container has any pageshasPage(\Zend_Navigation_Page $page, boolean $recursive = false
) : boolean
\Zend_Navigation_Page
page to look for
boolean
[optional] whether to search recursively. Default is false.
boolean
whether page is in containerhasPages() : boolean
boolean
whether container has any pageshashCode() : string
string
a hash code value for this pageisActive(boolean $recursive = false
) : boolean
This method will compare the page properties against the request object that is found in the front controller.
inherited_from | \Zend_Navigation_Page::isActive() |
---|
boolean
[optional] whether page should be considered active if any child pages are active. Default is false.
boolean
whether page should be considered active or notisActive(boolean $recursive = false
) : boolean
boolean
[optional] whether page should be considered active if any child pages are active. Default is false.
boolean
whether page should be considered activeisVisible(boolean $recursive = false
) : boolean
boolean
[optional] whether page should be considered invisible if parent is invisible. Default is false.
boolean
whether page should be considered visiblekey() : string
Implements RecursiveIterator interface.
string
hash code of current pagenext() : void
Implements RecursiveIterator interface.
notifyOrderUpdated() : void
removeCustomHtmlAttrib(string $name) : \Zend_Navigation_Page
string
name of the custom HTML attribute
\Zend_Navigation_Page
fluent interface, returns selfremovePage(\Zend_Navigation_Page|integer $page, boolean $recursive = false
) : boolean
\Zend_Navigation_Page
integer
page to remove, either a page instance or a specific page order
boolean
[optional] whether to remove recursively
boolean
whether the removal was successfulremovePages() : \Zend_Navigation_Container
\Zend_Navigation_Container
fluent interface, returns selfremoveParam(string $name) : boolean
removeRel(string $relation) : \Zend_Navigation_Page
string
name of relation to remove
\Zend_Navigation_Page
fluent interface, returns selfremoveRev(string $relation) : \Zend_Navigation_Page
string
name of relation to remove
\Zend_Navigation_Page
fluent interface, returns selfrewind() : void
Implements RecursiveIterator interface.
set(string $property, mixed $value) : \Zend_Navigation_Page
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 name
mixed
value to set
\Zend_Navigation_Exception |
if property name is invalid |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetAccesskey(string|null $character = null
) : \Zend_Navigation_Page
string
null
[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 |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetAction(string $action) : \Zend_Navigation_Page_Mvc
setActive(boolean $active = true
) : \Zend_Navigation_Page
boolean
[optional] whether page should be considered active or not. Default is true.
\Zend_Navigation_Page
fluent interface, returns selfsetClass(string|null $class = null
) : \Zend_Navigation_Page
string
null
[optional] CSS class to set. Default is null, which sets no CSS class.
\Zend_Navigation_Exception |
if not given string or null |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetConfig(\Zend_Config $config) : \Zend_Navigation_Page
\Zend_Config
config object to get properties from
\Zend_Navigation_Exception |
if invalid options are given |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetController(string|null $controller) : \Zend_Navigation_Page_Mvc
setCustomHtmlAttrib(string $name, string|null $value) : \Zend_Navigation_Page
string
name of the HTML attribute
string
null
value for the HTML attribute
\Zend_Navigation_Exception |
if name is not string or value is not null or a string |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetCustomHtmlAttribs(array $attribs) : \Zend_Navigation_Page
array
an associative array of html attributes
\Zend_Navigation_Page
fluent interface, returns selfsetDefaultPageType($type = null
)
setEncodeUrl($encodeUrl) : \Zend_Navigation_Page_Mvc
setFragment(string $fragment) : \Zend_Navigation_Page
string
new fragment identifier
\Zend_Navigation_Exception |
if empty/no string is given |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetId(string|null $id = null
) : \Zend_Navigation_Page
string
null
[optional] id to set. Default is null, which sets no id.
\Zend_Navigation_Exception |
if not given string or null |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetLabel(string $label) : \Zend_Navigation_Page
string
new page label
\Zend_Navigation_Exception |
if empty/no string is given |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetModule(string|null $module) : \Zend_Navigation_Page_Mvc
setOptions(array $options) : \Zend_Navigation_Page
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
associative array of options to set
\Zend_Navigation_Exception |
if invalid options are given |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetOrder(integer $order = null
) : \Zend_Navigation_Page
integer
[optional] page order in container. Default is null, which sets no specific order.
\Zend_Navigation_Exception |
if order is not integer or null |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetPages(array<mixed,\Zend_Navigation_Page> $pages) : \Zend_Navigation_Container
array<mixed,\Zend_Navigation_Page>
pages to set
\Zend_Navigation_Container
fluent interface, returns selfsetParam(string $name, mixed $value) : \Zend_Navigation_Page_Mvc
setParams(array|null $params = null
) : \Zend_Navigation_Page_Mvc
setParent(\Zend_Navigation_Container $parent = null
) : \Zend_Navigation_Page
\Zend_Navigation_Container
[optional] new parent to set. Default is null which will set no parent.
\Zend_Navigation_Page
fluent interface, returns selfsetPrivilege(string|null $privilege = null
) : \Zend_Navigation_Page
string
null
[optional] ACL privilege to associate with this page. Default is null, which sets no privilege.
\Zend_Navigation_Page
fluent interface, returns selfsetRel(array|\Zend_Config $relations = null
) : \Zend_Navigation_Page
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
[optional] an associative array of forward links to other pages
\Zend_Navigation_Page
fluent interface, returns selfsetResetParams(boolean $resetParams) : \Zend_Navigation_Page_Mvc
setResource(string|\Zend_Acl_Resource_Interface $resource = null
) : \Zend_Navigation_Page
string
\Zend_Acl_Resource_Interface
[optional] resource to associate with page. Default is null, which sets no resource.
\Zend_Navigation_Exception |
if $resource if invalid |
---|
\Zend_Navigation_Page
fluent interface,
returns selfsetRev(array|\Zend_Config $relations = null
) : \Zend_Navigation_Page
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
[optional] an associative array of reverse links to other pages
\Zend_Navigation_Page
fluent interface, returns selfsetRoute(string $route) : \Zend_Navigation_Page_Mvc
setScheme(string|null $scheme) : \Zend_Navigation_Page_Mvc
setSchemeHelper(\Zend_View_Helper_ServerUrl $sh) : void
setTarget(string|null $target = null
) : \Zend_Navigation_Page
string
null
[optional] target to set. Default is null, which sets no target.
\Zend_Navigation_Exception |
if target is not string or null |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetTitle(string $title = null
) : \Zend_Navigation_Page
string
[optional] page title. Default is null, which sets no title.
\Zend_Navigation_Exception |
if not given string or null |
---|
\Zend_Navigation_Page
fluent interface, returns selfsetUrlHelper(\Zend_Controller_Action_Helper_Url $uh) : void
setVisible(boolean $visible = true
) : \Zend_Navigation_Page
boolean
[optional] whether page should be considered visible or not. Default is true.
\Zend_Navigation_Page
fluent interface, returns selftoArray() : array
inherited_from | \Zend_Navigation_Page::toArray() |
---|
array
associative array containing all page propertiestoArray() : array<mixed,\Zend_Navigation_Page>
array<mixed,\Zend_Navigation_Page>
valid() : boolean
Implements RecursiveIterator interface.
boolean
_init() : void
_normalizePropertyName(string $property) : string
string
property name to normalize
string
normalized property name_sort() : void
$_accesskey : string | null
This attribute assigns an access key to an element. An access key is a single character from the document character set.
link | http://www.w3.org/TR/html401/interact/forms.html#access-keys |
---|
$_action : string
$_active : boolean
null
inherited_from | \Zend_Navigation_Page::_active |
---|
$_active : boolean
false
$_class : string | null
$_controller : string
$_customHtmlAttribs : array
array()
$_defaultPageType : string
$_dirtyIndex : boolean
false
$_fragment : string | null
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)
link | http://www.w3.org/TR/html401/intro/intro.html#fragment-uri |
---|
$_hrefCache : string
The use of this variable minimizes execution time when getHref() is called more than once during the lifetime of a request. If a property is updated, the cache is invalidated.
$_id : string | null
$_index : array
array()
$_label : string | null
$_module : string
$_order : integer | null
$_pages : array<mixed,\Zend_Navigation_Page>
array()
$_parent : \Zend_Navigation_Container | null
$_privilege : string | null
$_properties : array
array()
$_rel : array
array()
$_resource : string | \Zend_Acl_Resource_Interface | null
$_rev : array
array()
$_schemeHelper : \Zend_View_Helper_ServerUrl
null
$_target : string | null
$_title : string | null
$_urlHelper : \Zend_Controller_Action_Helper_Url
null
$_visible : boolean
true