Navigation/Page/Mvc.php
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
[email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Navigation
- Subpackage
- Page
- Version
- $Id$
\Zend_Navigation_Page_Mvc
Package: Zend_Navigation\PageRepresents 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.
- Parent(s)
- \Zend_Navigation_Page
<
\Zend_Navigation_Container
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
bool $_active = null
Whether this page should be considered active
Default valuenull
Details- Type
- bool
bool $_encodeUrl = true
Whether href should be encoded when assembling URL
Default valuetrue
Details- Type
- bool
- See
-
array $_params = array()
Params to use when assembling URL
Default valuearray()
Details- Type
- array
- See
-
bool $_resetParams = true
Whether params should be reset when assembling URL
Default valuetrue
Details- Type
- bool
- See
-
Methods
addParams(array $params) : \Zend_Navigation_Page_Mvc
Add multiple parameters (to use when assembling URL) at once
URL options passed to the url action helper for assembling URLs.
ParametersName | Type | Description |
---|
$params | array | paramters as array ('name' => 'value') |
---|
ReturnsDetails- See
-
getAction() : string | null
Returns action name to use when assembling URL
ReturnsType | Description |
---|
string | null | action name |
Details- See
-
getController() : string | null
Returns controller name to use when assembling URL
ReturnsType | Description |
---|
string | null | controller name or null |
Details- See
-
getEncodeUrl() : bool
Returns whether herf should be encoded when assembling URL
ReturnsType | Description |
---|
bool | whether herf should be encoded when assembling URL |
Details- See
-
getHref() : string
Returns href for this page
This method uses {@link Zend_Controller_Action_Helper_Url} to assemble
the href based on the page's properties.
ReturnsType | Description |
---|
string | page href |
getModule() : string | null
Returns module name to use when assembling URL
ReturnsType | Description |
---|
string | null | module name or null |
Details- See
-
getParam(string $name) : mixed
Retrieve a single parameter (to use when assembling URL)
ParametersName | Type | Description |
---|
$name | string | parameter name |
---|
ReturnsDetails- See
-
getParams() : array
Retrieve all parameters (to use when assembling URL)
ReturnsType | Description |
---|
array | parameters as array ('name' => 'value') |
Details- See
-
getResetParams() : bool
Returns whether params should be reset when assembling URL
ReturnsType | Description |
---|
bool | whether params should be reset when assembling URL |
Details- See
-
getRoute() : string
Returns route name to use when assembling URL
ReturnsType | Description |
---|
string | route name |
Details- See
-
getScheme() : string | null
Returns scheme to use when assembling URL
ReturnsType | Description |
---|
string | null | scheme or null |
Details- See
-
isActive(bool $recursive = false) : bool
Returns whether page should be considered active or not
This method will compare the page properties against the request object
that is found in the front controller.
ParametersName | Type | Description |
---|
$recursive | bool | [optional] whether page should be considered
active if any child pages are active. Default is
false.
|
---|
ReturnsType | Description |
---|
bool | whether page should be considered active or not |
removeParam(string $name) : bool
Remove parameter (to use when assembling URL)
ParametersName | Type | Description |
---|
$name | string | |
---|
ReturnsDetails- See
-
setAction(string $action) : \Zend_Navigation_Page_Mvc
Sets action name to use when assembling URL
ParametersName | Type | Description |
---|
$action | string | action name |
---|
ReturnsThrowsDetails- See
-
setController(string | null $controller) : \Zend_Navigation_Page_Mvc
Sets controller name to use when assembling URL
ParametersName | Type | Description |
---|
$controller | string | null | controller name |
---|
ReturnsThrowsDetails- See
-
setEncodeUrl( $encodeUrl) : \Zend_Navigation_Page_Mvc
Sets whether href should be encoded when assembling URL
ParametersName | Type | Description |
---|
$encodeUrl | | |
---|
ReturnsDetails- See
-
setModule(string | null $module) : \Zend_Navigation_Page_Mvc
Sets module name to use when assembling URL
ParametersName | Type | Description |
---|
$module | string | null | module name |
---|
ReturnsThrowsDetails- See
-
setParam(string $name, mixed $value) : \Zend_Navigation_Page_Mvc
Set parameter (to use when assembling URL)
URL option passed to the url action helper for assembling URLs.
ParametersName | Type | Description |
---|
$name | string | parameter name |
---|
$value | mixed | parameter value |
---|
ReturnsDetails- See
-
setParams(array | null $params = null) : \Zend_Navigation_Page_Mvc
Set multiple parameters (to use when assembling URL) at once
URL options passed to the url action helper for assembling URLs.
Overwrites any previously set parameters!
ParametersName | Type | Description |
---|
$params | array | null | [optional] paramters as array
('name' => 'value'). Default is null
which clears all params.
|
---|
ReturnsDetails- See
-
setResetParams(bool $resetParams) : \Zend_Navigation_Page_Mvc
Sets whether params should be reset when assembling URL
ParametersName | Type | Description |
---|
$resetParams | bool | whether params should be reset when
assembling URL |
---|
ReturnsDetails- See
-
setRoute(string $route) : \Zend_Navigation_Page_Mvc
Sets route name to use when assembling URL
ParametersName | Type | Description |
---|
$route | string | route name to use when assembling URL |
---|
ReturnsThrowsDetails- See
-
setScheme(string | null $scheme) : \Zend_Navigation_Page_Mvc
Sets scheme to use when assembling URL
ParametersName | Type | Description |
---|
$scheme | string | null | scheme |
---|
ReturnsThrowsDetails- See
-
toArray() : array
Returns an array representation of the page
ReturnsType | Description |
---|
array | associative array containing all page properties |