API Documentation

Navigation/Page.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Navigation
version
$Id: Page.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Navigation_Page

Description

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.

Zend_Navigation_Page

Extends from
Zend_Navigation_Container
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Navigation
Properties
$_label
$_id
$_class
$_title
$_target
$_rel
$_rev
$_order
$_resource
$_privilege
$_active
$_visible
$_parent
$_properties
Methods
factory
__construct
_init
setConfig
setOptions
setLabel
getLabel
setId
getId
setClass
getClass
setTitle
getTitle
setTarget
getTarget
setRel
getRel
setRev
getRev
setOrder
getOrder
setResource
getResource
setPrivilege
getPrivilege
setActive
isActive
getActive
setVisible
isVisible
getVisible
setParent
getParent
set
get
__set
__get
__isset
__unset
__toString
addRel
addRev
removeRel
removeRev
getDefinedRel
getDefinedRev
getCustomProperties
hashCode
toArray
_normalizePropertyName
getHref

Description

Base class for Zend_Navigation_Page pages

Properties

$_active

bool $_active = 'false'

Whether this page should be considered active

Details

$_active
bool
visibility
protected
default
false
final
false
static
false

$_class

string|null $_class = ''

Style class for this page (CSS)

Details

$_class
string|null
visibility
protected
default
final
false
static
false

$_id

string|null $_id = ''

Page id

Details

$_id
string|null
visibility
protected
default
final
false
static
false

$_label

string|null $_label = ''

Page label

Details

$_label
string|null
visibility
protected
default
final
false
static
false

$_order

int|null $_order = ''

Page order used by parent container

Details

$_order
int|null
visibility
protected
default
final
false
static
false

$_parent

Zend_Navigation_Container|null $_parent = ''

Parent container

Details

$_parent
Zend_Navigation_Container|null
visibility
protected
default
final
false
static
false

$_privilege

string|null $_privilege = ''

ACL privilege associated with this page

Details

$_privilege
string|null
visibility
protected
default
final
false
static
false

$_properties

array $_properties = 'array'

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

Details

$_properties
array
visibility
protected
default
array
final
false
static
false

$_rel

array $_rel = 'array'

Forward links to other pages

Details

$_rel
array
visibility
protected
default
array
final
false
static
false
link
http://www.w3.org/TR/html4/struct/links.html#h-12.3.1

$_resource

string|Zend_Acl_Resource_Interface|null $_resource = ''

ACL resource associated with this page

Details

$_resource
string|Zend_Acl_Resource_Interface|null
visibility
protected
default
final
false
static
false

$_rev

array $_rev = 'array'

Reverse links to other pages

Details

$_rev
array
visibility
protected
default
array
final
false
static
false
link
http://www.w3.org/TR/html4/struct/links.html#h-12.3.1

$_target

string|null $_target = ''

This page's target

Details

$_target
string|null
visibility
protected
default
final
false
static
false

$_title

string|null $_title = ''

A more descriptive title for this page

Details

$_title
string|null
visibility
protected
default
final
false
static
false

$_visible

bool $_visible = 'true'

Whether this page should be considered visible

Details

$_visible
bool
visibility
protected
default
true
final
false
static
false

Methods

__construct

__construct( array|Zend_Config $options = null ) :

Page constructor

Arguments
$options
arrayZend_Config
[optional] page options. Default is null, which should set defaults.
Details
visibility
public
final
false
static
false
throws
if invalid options are given

__get

__get( string $name ) : mixed

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

Magic overload for enabling $page->propname.

Arguments
$name
string
property name
Output
mixed
property value or null
Details
visibility
public
final
false
static
false
throws
if property name is invalid

__isset

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

Arguments
$name
string
property name
Output
bool
whether the given property exists
Details
visibility
public
final
false
static
false

__set

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

Sets a custom property

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

Arguments
$name
string
property name
$value
mixed
value to set
Details
visibility
public
final
false
static
false
throws
if property name is invalid

__toString

__toString( ) : string

Returns page label

Magic overload for enabling echo $page.

Output
string
page label
Details
visibility
public
final
false
static
false

__unset

__unset( string $name ) : void

Unsets the given custom property

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

Arguments
$name
string
property name
Details
visibility
public
final
false
static
false
throws
if the property is native

_init

_init( ) : void

Initializes page (used by subclasses)

Details
visibility
protected
final
false
static
false

_normalizePropertyName

_normalizePropertyName( string $property ) : string

Normalizes a property name

Arguments
$property
string
property name to normalize
Output
string
normalized property name
Details
visibility
protected
final
false
static
true

addRel

addRel( string $relation, mixed $value ) : Zend_Navigation_Page

Adds a forward relation to the page

Arguments
$relation
string
relation name (e.g. alternate, glossary, canonical, etc)
$value
mixed
value to set for relation
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

addRev

addRev( string $relation, mixed $value ) : Zend_Navigation_Page

Adds a reverse relation to the page

Arguments
$relation
string
relation name (e.g. alternate, glossary, canonical, etc)
$value
mixed
value to set for relation
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

factory

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.

Arguments
$options
arrayZend_Config
options used for creating page
Output
Zend_Navigation_Page
a page instance
Details
visibility
public
final
false
static
true
throws
if $options is not array/Zend_Config
throws
if 'type' is specified and Zend_Loader is unable to load the class
throws
if something goes wrong during instantiation of the page
throws
if 'type' is given, and the specified type does not extend this class
throws
if unable to determine which class to instantiate

get

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.

Arguments
$property
string
property name
Output
mixed
the property's value or null
Details
visibility
public
final
false
static
false
throws
if property name is invalid

getActive

getActive( bool $recursive = false ) : bool

Proxy to isActive()

Arguments
$recursive
bool
[optional] whether page should be considered active if any child pages are active. Default is false.
Output
bool
whether page should be considered active
Details
visibility
public
final
false
static
false

getClass

getClass( ) : string|null

Returns page class (CSS)

Output
string|null
page's CSS class or null
Details
visibility
public
final
false
static
false

getCustomProperties

getCustomProperties( ) : array

Returns custom properties as an array

Output
array
an array containing custom properties
Details
visibility
public
final
false
static
false

getDefinedRel

getDefinedRel( ) : array

Returns an array containing the defined forward relations

Output
array
defined forward relations
Details
visibility
public
final
false
static
false

getDefinedRev

getDefinedRev( ) : array

Returns an array containing the defined reverse relations

Output
array
defined reverse relations
Details
visibility
public
final
false
static
false

getHref

getHref( ) : string

Returns href for this page

Output
string
the page's href
Details
visibility
public
final
false
static
false

getId

getId( ) : string|null

Returns page id

Output
string|null
page id or null
Details
visibility
public
final
false
static
false

getLabel

getLabel( ) : string

Returns page label

Output
string
page label or null
Details
visibility
public
final
false
static
false

getOrder

getOrder( ) : int|null

Returns page order used in parent container

Output
int|null
page order or null
Details
visibility
public
final
false
static
false

getParent

getParent( ) : Zend_Navigation_Container|null

Returns parent container

Output
Zend_Navigation_Container|null
parent container or null
Details
visibility
public
final
false
static
false

getPrivilege

getPrivilege( ) : string|null

Returns ACL privilege associated with this page

Output
string|null
ACL privilege or null
Details
visibility
public
final
false
static
false

getRel

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.

Arguments
$relation
string
[optional] name of relation to return. If not given, all relations will be returned.
Output
array
an array of relations. If $relation is not specified, all relations will be returned in an associative array.
Details
visibility
public
final
false
static
false

getResource

getResource( ) : string|Zend_Acl_Resource_Interface|null

Returns ACL resource assoicated with this page

Output
string|Zend_Acl_Resource_Interface|null
ACL resource or null
Details
visibility
public
final
false
static
false

getRev

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.

Arguments
$relation
string
[optional] name of relation to return. If not given, all relations will be returned.
Output
array
an array of relations. If $relation is not specified, all relations will be returned in an associative array.
Details
visibility
public
final
false
static
false

getTarget

getTarget( ) : string|null

Returns page target

Output
string|null
page target or null
Details
visibility
public
final
false
static
false

getTitle

getTitle( ) : string|null

Returns page title

Output
string|null
page title or null
Details
visibility
public
final
false
static
false

getVisible

getVisible( bool $recursive = false ) : bool

Proxy to isVisible()

Returns a boolean value indicating whether the page is visible

Arguments
$recursive
bool
[optional] whether page should be considered invisible if parent is invisible. Default is false.
Output
bool
whether page should be considered visible
Details
visibility
public
final
false
static
false

hashCode

hashCode( ) : string

Returns a hash code value for the page

Output
string
a hash code value for this page
Details
visibility
public
final
true
static
false

isActive

isActive( bool $recursive = false ) : bool

Returns whether page should be considered active or not

Arguments
$recursive
bool
[optional] whether page should be considered active if any child pages are active. Default is false.
Output
bool
whether page should be considered active
Details
visibility
public
final
false
static
false

isVisible

isVisible( bool $recursive = false ) : bool

Returns a boolean value indicating whether the page is visible

Arguments
$recursive
bool
[optional] whether page should be considered invisible if parent is invisible. Default is false.
Output
bool
whether page should be considered visible
Details
visibility
public
final
false
static
false

removeRel

removeRel( string $relation ) : Zend_Navigation_Page

Removes a forward relation from the page

Arguments
$relation
string
name of relation to remove
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

removeRev

removeRev( string $relation ) : Zend_Navigation_Page

Removes a reverse relation from the page

Arguments
$relation
string
name of relation to remove
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

set

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.

Arguments
$property
string
property name
$value
mixed
value to set
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if property name is invalid

setActive

setActive( bool $active = true ) : Zend_Navigation_Page

Sets whether page should be considered active or not

Arguments
$active
bool
[optional] whether page should be considered active or not. Default is true.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

setClass

setClass( string|null $class = null ) : Zend_Navigation_Page

Sets page CSS class

Arguments
$class
stringnull
[optional] CSS class to set. Default is null, which sets no CSS class.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if not given string or null

setConfig

setConfig( Zend_Config $config ) : Zend_Navigation_Page

Sets page properties using a Zend_Config object

Arguments
$config
Zend_Config
config object to get properties from
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if invalid options are given

setId

setId( string|null $id = null ) : Zend_Navigation_Page

Sets page id

Arguments
$id
stringnull
[optional] id to set. Default is null, which sets no id.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if not given string or null

setLabel

setLabel( string $label ) : Zend_Navigation_Page

Sets page label

Arguments
$label
string
new page label
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if empty/no string is given

setOptions

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

Arguments
$options
array
associative array of options to set
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if invalid options are given

setOrder

setOrder( int $order = null ) : Zend_Navigation_Page

Sets page order to use in parent container

Arguments
$order
int
[optional] page order in container. Default is null, which sets no specific order.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if order is not integer or null

setParent

setParent( Zend_Navigation_Container $parent = null ) : Zend_Navigation_Page

Sets parent container

Arguments
$parent
Zend_Navigation_Container
[optional] new parent to set. Default is null which will set no parent.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

setPrivilege

setPrivilege( string|null $privilege = null ) : Zend_Navigation_Page

Sets ACL privilege associated with this page

Arguments
$privilege
stringnull
[optional] ACL privilege to associate with this page. Default is null, which sets no privilege.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

setRel

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.

Arguments
$relations
arrayZend_Config
[optional] an associative array of forward links to other pages
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

setResource

setResource( string|Zend_Acl_Resource_Interface $resource = null ) : Zend_Navigation_Page

Sets ACL resource assoicated with this page

Arguments
$resource
stringZend_Acl_Resource_Interface
[optional] resource to associate with page. Default is null, which sets no resource.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if $resource if invalid

setRev

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.

Arguments
$relations
arrayZend_Config
[optional] an associative array of reverse links to other pages
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

setTarget

setTarget( string|null $target = null ) : Zend_Navigation_Page

Sets page target

Arguments
$target
stringnull
[optional] target to set. Default is null, which sets no target.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if target is not string or null

setTitle

setTitle( string $title = null ) : Zend_Navigation_Page

Sets page title

Arguments
$title
string
[optional] page title. Default is null, which sets no title.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false
throws
if not given string or null

setVisible

setVisible( bool $visible = true ) : Zend_Navigation_Page

Sets whether the page should be visible or not

Arguments
$visible
bool
[optional] whether page should be considered visible or not. Default is true.
Output
Zend_Navigation_Page
fluent interface, returns self
Details
visibility
public
final
false
static
false

toArray

toArray( ) : array

Returns an array representation of the page

Output
array
associative array containing all page properties
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.