Represents a page that is defined by specifying a URI

AbstractContainer class for Zend\Navigation\Page classes.

package Default
inherited_from \Zend\Navigation\Page\AbstractPage

 Methods

Magic overload: Proxy calls to finder methods

__call(string $method, array $arguments) 
Inherited

Examples of finder calls: // METHOD // SAME AS $nav->findByLabel('foo'); // $nav->findOneBy('label', 'foo'); $nav->findOneByLabel('foo'); // $nav->findOneBy('label', 'foo'); $nav->findAllByClass('foo'); // $nav->findAllBy('class', 'foo');

Parameters

$method

string

method name

$arguments

array

method arguments

Exceptions

\Zend\Navigation\Exception\BadMethodCallException if method does not exist

Page constructor

__construct(array|\Traversable $options = null
Inherited

Parameters

$options

array\Traversable

[optional] page options. Default is null, which should set defaults.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if invalid options are given

Returns a property, or null if it doesn't exist

__get(string $name) : mixed
Inherited

Magic overload for enabling $page->propname.

Parameters

$name

string

property name

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if property name is invalid

Returns

mixedproperty value or null

Checks if a property is set

__isset(string $name) : boolean
Inherited

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).

Parameters

$name

string

property name

Returns

booleanwhether the given property exists

Sets a custom property

__set(string $name, mixed $value) : void
Inherited

Magic overload for enabling $page->propname = $value.

Parameters

$name

string

property name

$value

mixed

value to set

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if property name is invalid

Returns page label

__toString() : string
Inherited

Magic overload for enabling echo $page.

Returns

stringpage label

Unsets the given custom property

__unset(string $name) : void
Inherited

Magic overload for enabling unset($page->propname).

Parameters

$name

string

property name

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if the property is native

Add static factory for self::factory function

addFactory(callable $callback) 
InheritedStatic

Parameters

$callback

callable

Any callable variable

Adds a page to the container

addPage(\Zend\Navigation\Page\AbstractPage|array|\Traversable $page) : \Zend\Navigation\Page\Uri
Inherited

This method will inject the container as the given page's parent by calling \Page\AbstractPage::setParent().

fluent This method is part of a fluent interface and will return the same instance

Parameters

$page

\Zend\Navigation\Page\AbstractPagearray\Traversable

page to add

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if page is invalid

Returns

\Zend\Navigation\Page\Urifluent interface, returns self

Adds several pages at once

addPages(array|\Traversable|\Zend\Navigation\AbstractContainer $pages) : \Zend\Navigation\Page\Uri
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$pages

array\Traversable\Zend\Navigation\AbstractContainer

pages to add

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if $pages is not array, Traversable or AbstractContainer

Returns

\Zend\Navigation\Page\Urifluent interface, returns self

Adds a forward relation to the page

addRel(string $relation, mixed $value) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$relation

string

relation name (e.g. alternate, glossary, canonical, etc)

$value

mixed

value to set for relation

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Adds a reverse relation to the page

addRev(string $relation, mixed $value) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$relation

string

relation name (e.g. alternate, glossary, canonical, etc)

$value

mixed

value to set for relation

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Returns number of pages in container

count() : integer
Inherited

Implements Countable interface.

Returns

integernumber of pages in the container

Returns current page

current() : \Zend\Navigation\Page\AbstractPage
Inherited

Implements RecursiveIterator interface.

Exceptions

\Zend\Navigation\Exception\OutOfBoundsException if the index is invalid

Returns

\Zend\Navigation\Page\AbstractPagecurrent page or null

Factory for Zend\Navigation\Page classes

factory(array|\Traversable $options) : \Zend\Navigation\Page\AbstractPage
InheritedStatic

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\AbstractPage.

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', 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.

Parameters

$options

array\Traversable

options used for creating page

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if $options is not array/Traversable
\Zend\Navigation\Exception\InvalidArgumentException if 'type' is specified but class not found
\Zend\Navigation\Exception\InvalidArgumentException if something goes wrong during instantiation of the page
\Zend\Navigation\Exception\InvalidArgumentException if 'type' is given, and the specified type does not extend this class
\Zend\Navigation\Exception\InvalidArgumentException if unable to determine which class to instantiate

Returns

\Zend\Navigation\Page\AbstractPagea page instance

Returns all child pages matching $property == $value, or an empty array if no pages are found

findAllBy(string $property, mixed $value) : array
Inherited

Parameters

$property

string

name of property to match against

$value

mixed

value to match property against

Returns

arrayarray containing only Page\AbstractPage instances

Returns page(s) matching $property == $value

findBy(string $property, mixed $value, boolean $all = false) : \Zend\Navigation\Page\AbstractPage | null
Inherited

Parameters

$property

string

name of property to match against

$value

mixed

value to match property against

$all

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.

Returns

\Zend\Navigation\Page\AbstractPagenullmatching page or null

Returns a child page matching $property == $value, or null if not found

findOneBy(string $property, mixed $value) : \Zend\Navigation\Page\AbstractPage | null
Inherited

Parameters

$property

string

name of property to match against

$value

mixed

value to match property against

Returns

\Zend\Navigation\Page\AbstractPagenullmatching page or null

Returns the value of the given property

get(string $property) : mixed
Inherited

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.

Parameters

$property

string

property name

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if property name is invalid

Returns

mixedthe property's value or null

Proxy to isActive()

getActive(boolean $recursive = false) : boolean
Inherited

Parameters

$recursive

boolean

[optional] whether page should be considered active if any child pages are active. Default is false.

Returns

booleanwhether page should be considered active

Returns the child container.

getChildren() : \Zend\Navigation\Page\AbstractPage | null
Inherited

Implements RecursiveIterator interface.

Returns

\Zend\Navigation\Page\AbstractPagenull

Returns page class (CSS)

getClass() : string | null
Inherited

Returns

stringnullpage's CSS class or null

Returns custom properties as an array

getCustomProperties() : array
Inherited

Returns

arrayan array containing custom properties

Returns an array containing the defined forward relations

getDefinedRel() : array
Inherited

Returns

arraydefined forward relations

Returns an array containing the defined reverse relations

getDefinedRev() : array
Inherited

Returns

arraydefined reverse relations

Returns fragment identifier

getFragment() : string | null
Inherited

Returns

stringnullfragment identifier

Returns href for this page

getHref() : string

Includes the fragment identifier if it is set.

inherited_from \Zend\Navigation\Page\AbstractPage::getHref()

Returns

string

Returns href for this page

getHref() : string
Inherited

Returns

stringthe page's href

Returns page id

getId() : string | null
Inherited

Returns

stringnullpage id or null

Returns page label

getLabel() : string
Inherited

Returns

stringpage label or null

Returns page order used in parent container

getOrder() : integer | null
Inherited

Returns

integernullpage order or null

Returns pages in the container

getPages() : array
Inherited

Returns

arrayarray of Page\AbstractPage instances

Returns parent container

getParent() : \Zend\Navigation\AbstractContainer | null
Inherited

Returns

\Zend\Navigation\AbstractContainernullparent container or null

Returns permission associated with this page

getPermission() : mixed | null
Inherited

Returns

mixednullpermission or null

Returns ACL privilege associated with this page

getPrivilege() : string | null
Inherited

Returns

stringnullACL privilege or null

Returns the page's forward links to other pages

getRel(string $relation = null) : array
Inherited

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.

Parameters

$relation

string

[optional] name of relation to return. If not given, all relations will be returned.

Returns

arrayan array of relations. If $relation is not specified, all relations will be returned in an associative array.

Get the request

getRequest() : \Zend\Http\Request

Returns

\Zend\Http\Request

Returns ACL resource associated with this page

getResource() : string | \Zend\Permissions\Acl\Resource\ResourceInterface | null
Inherited

Returns

string\Zend\Permissions\Acl\Resource\ResourceInterfacenullACL resource or null

Returns the page's reverse links to other pages

getRev(string $relation = null) : array
Inherited

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.

Parameters

$relation

string

[optional] name of relation to return. If not given, all relations will be returned.

Returns

arrayan array of relations. If $relation is not specified, all relations will be returned in an associative array.

Returns page target

getTarget() : string | null
Inherited

Returns

stringnullpage target or null

Returns text domain for translation

getTextDomain() : mixed | null
Inherited

Returns

mixednulltext domain or null

Returns page title

getTitle() : string | null
Inherited

Returns

stringnullpage title or null

Returns URI

getUri() : string

Returns

string

Proxy to isVisible()

getVisible(boolean $recursive = false) : boolean
Inherited

Returns a boolean value indicating whether the page is visible

Parameters

$recursive

boolean

[optional] whether page should be considered invisible if parent is invisible. Default is false.

Returns

booleanwhether page should be considered visible

Proxy to hasPages()

hasChildren() : boolean
Inherited

Implements RecursiveIterator interface.

Returns

booleanwhether container has any pages

Checks if the container has the given page

hasPage(\Zend\Navigation\Page\AbstractPage $page, boolean $recursive = false) : boolean
Inherited

Parameters

$page

\Zend\Navigation\Page\AbstractPage

page to look for

$recursive

boolean

[optional] whether to search recursively. Default is false.

Returns

booleanwhether page is in container

Returns true if container contains any pages

hasPages(boolean $onlyVisible = false) : boolean
Inherited

Parameters

$onlyVisible

boolean

whether to check only visible pages

Returns

booleanwhether container has any pages

Returns a hash code value for the page

hashCode() : string
Inherited

Returns

stringa hash code value for this page

Returns whether page should be considered active or not

isActive(boolean $recursive = false) : boolean

This method will compare the page properties against the request uri.

inherited_from \Zend\Navigation\Page\AbstractPage::isActive()

Parameters

$recursive

boolean

[optional] whether page should be considered active if any child pages are active. Default is false.

Returns

booleanwhether page should be considered active or not

Returns whether page should be considered active or not

isActive(boolean $recursive = false) : boolean
Inherited

Parameters

$recursive

boolean

[optional] whether page should be considered active if any child pages are active. Default is false.

Returns

booleanwhether page should be considered active

Returns a boolean value indicating whether the page is visible

isVisible(boolean $recursive = false) : boolean
Inherited

Parameters

$recursive

boolean

[optional] whether page should be considered invisible if parent is invisible. Default is false.

Returns

booleanwhether page should be considered visible

Returns hash code of current page

key() : string
Inherited

Implements RecursiveIterator interface.

Returns

stringhash code of current page

Moves index pointer to next page in the container

next() : void
Inherited

Implements RecursiveIterator interface.

Notifies container that the order of pages are updated

notifyOrderUpdated() : void
Inherited

Removes the given page from the container

removePage(\Zend\Navigation\Page\AbstractPage|integer $page, boolean $recursive = false) : boolean
Inherited

Parameters

$page

\Zend\Navigation\Page\AbstractPageinteger

page to remove, either a page instance or a specific page order

$recursive

boolean

[optional] whether to remove recursively

Returns

booleanwhether the removal was successful

Removes all pages in container

removePages() : \Zend\Navigation\Page\Uri
Inherited
fluent This method is part of a fluent interface and will return the same instance

Returns

\Zend\Navigation\Page\Urifluent interface, returns self

Removes a forward relation from the page

removeRel(string $relation) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$relation

string

name of relation to remove

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Removes a reverse relation from the page

removeRev(string $relation) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$relation

string

name of relation to remove

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets index pointer to first page in the container

rewind() : void
Inherited

Implements RecursiveIterator interface.

Sets the given property

set(string $property, mixed $value) : \Zend\Navigation\Page\AbstractPage
Inherited

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.

Parameters

$property

string

property name

$value

mixed

value to set

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if property name is invalid

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets whether page should be considered active or not

setActive(boolean $active = true) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$active

boolean

[optional] whether page should be considered active or not. Default is true.

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page CSS class

setClass(string|null $class = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$class

stringnull

[optional] CSS class to set. Default is null, which sets no CSS class.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if not given string or null

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets a fragment identifier

setFragment(string $fragment) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$fragment

string

new fragment identifier

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if empty/no string is given

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page id

setId(string|null $id = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$id

stringnull

[optional] id to set. Default is null, which sets no id.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if not given string or null

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page label

setLabel(string $label) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$label

string

new page label

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if empty/no string is given

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page properties using options from an associative array

setOptions(array $options) : \Zend\Navigation\Page\AbstractPage
Inherited

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().

Parameters

$options

array

associative array of options to set

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if invalid options are given

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page order to use in parent container

setOrder(integer $order = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$order

integer

[optional] page order in container. Default is null, which sets no specific order.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if order is not integer or null

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets pages this container should have, removing existing pages

setPages(array $pages) : \Zend\Navigation\Page\Uri
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$pages

array

pages to set

Returns

\Zend\Navigation\Page\Urifluent interface, returns self

Sets parent container

setParent(\Zend\Navigation\AbstractContainer $parent = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$parent

\Zend\Navigation\AbstractContainer

[optional] new parent to set. Default is null which will set no parent.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets permission associated with this page

setPermission(mixed|null $permission = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$permission

mixednull

[optional] permission to associate with this page. Default is null, which sets no permission.

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets ACL privilege associated with this page

setPrivilege(string|null $privilege = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$privilege

stringnull

[optional] ACL privilege to associate with this page. Default is null, which sets no privilege.

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets the page's forward links to other pages

setRel(array|\Traversable $relations = null) : \Zend\Navigation\Page\AbstractPage
Inherited

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.

Parameters

$relations

array\Traversable

[optional] an associative array of forward links to other pages

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if $relations is not an array or Traversable object

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets request for assembling URLs

setRequest(\Zend\Http\Request $request = null) : \Zend\Navigation\Page\Uri
fluent This method is part of a fluent interface and will return the same instance

Parameters

$request

\Zend\Http\Request

Returns

\Zend\Navigation\Page\UriFluent interface, returns self

Sets ACL resource associated with this page

setResource(string|\Zend\Permissions\Acl\Resource\ResourceInterface $resource = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$resource

string\Zend\Permissions\Acl\Resource\ResourceInterface

[optional] resource to associate with page. Default is null, which sets no resource.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if $resource is invalid

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets the page's reverse links to other pages

setRev(array|\Traversable $relations = null) : \Zend\Navigation\Page\AbstractPage
Inherited

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.

Parameters

$relations

array\Traversable

[optional] an associative array of reverse links to other pages

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if $relations it not an array or Traversable object

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page target

setTarget(string|null $target = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$target

stringnull

[optional] target to set. Default is null, which sets no target.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if target is not string or null

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets text domain for translation

setTextDomain(string|null $textDomain = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$textDomain

stringnull

[optional] text domain to associate with this page. Default is null, which sets no text domain.

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page title

setTitle(string $title = null) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$title

string

[optional] page title. Default is null, which sets no title.

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if not given string or null

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Sets page URI

setUri(string $uri) : \Zend\Navigation\Page\Uri

Parameters

$uri

string

page URI, must a string or null

Exceptions

\Zend\Navigation\Exception\InvalidArgumentException if $uri is invalid

Returns

\Zend\Navigation\Page\Urifluent interface, returns self

Sets whether the page should be visible or not

setVisible(boolean $visible = true) : \Zend\Navigation\Page\AbstractPage
Inherited

Parameters

$visible

boolean

[optional] whether page should be considered visible or not. Default is true.

Returns

\Zend\Navigation\Page\AbstractPagefluent interface, returns self

Returns an array representation of the page

toArray() : array
inherited_from \Zend\Navigation\Page\AbstractPage::toArray()

Returns

array

Returns an array representation of all pages in container

toArray() : array
Inherited

Returns

array

Checks if container index is valid

valid() : boolean
Inherited

Implements RecursiveIterator interface.

Returns

boolean

Initializes page (used by subclasses)

init() : void
Inherited

Normalizes a property name

normalizePropertyName(string $property) : string
InheritedStatic

Parameters

$property

string

property name to normalize

Returns

stringnormalized property name

Sorts the page index according to page order

sort() : void
Inherited

 Properties

 

Whether this page should be considered active

$active : boolean

Default

false
 

Style class for this page (CSS)

$class : string | null

Default

 

Whether index is dirty and needs to be re-arranged

$dirtyIndex : boolean

Default

false
 

Static factories list for factory pages

$factories : array

Default

array()
Static
 

Fragment identifier (anchor identifier)

$fragment : string | null

Default

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
 

Page id

$id : string | null

Default

 

An index that contains the order in which to iterate pages

$index : array

Default

array()
 

Page label

$label : string | null

Default

 

Page order used by parent container

$order : integer | null

Default

 

Contains sub pages

$pages : array

Default

array()
 

Parent container

$parent : \Zend\Navigation\AbstractContainer | null

Default

 

Permission associated with this page

$permission : mixed | null

Default

 

ACL privilege associated with this page

$privilege : string | null

Default

 

Custom page properties, used by __set(), __get() and __isset()

$properties : array

Default

array()
 

Forward links to other pages

$rel : array

Default

array()
 

Request object used to determine uri path

$request : string

Default

 

ACL resource associated with this page

$resource : string | \Zend\Permissions\Acl\Resource\ResourceInterface | null

Default

 

Reverse links to other pages

$rev : array

Default

array()
 

This page's target

$target : string | null

Default

 

Text domain for Translator

$textDomain : string

Default

 

A more descriptive title for this page

$title : string | null

Default

 

Page URI

$uri : string | null

Default

null
 

Whether this page should be considered visible

$visible : boolean

Default

true