Perforce Chronicle 2012.2/486814
API Documentation
|
Extends Zend_Navigation_Page_Mvc to generate page href with optionally disabled encoding. More...
Public Member Functions | |
getHref () | |
Overwritten parent to allow assembling url with disabled encoding. | |
getLabel () | |
Returns page label with support for macros. | |
getTitle () | |
Returns page title with support for macros. | |
setEncode ($encode) | |
Set whether to encode page href generated by getHref() method. | |
toArray () | |
Returns an array representation of the page. | |
Protected Attributes | |
$_encode = true |
Extends Zend_Navigation_Page_Mvc to generate page href with optionally disabled encoding.
P4Cms_Navigation_Page_Mvc::getHref | ( | ) |
Overwritten parent to allow assembling url with disabled encoding.
Parent method provided by Zend doesn't provide any option to disable href encoding, which is needed in some cases (e.g. for category links).
{ if ($this->_hrefCache) { return $this->_hrefCache; } if (null === self::$_urlHelper) { self::$_urlHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Url'); } $params = $this->getParams(); if ($param = $this->getModule()) { $params['module'] = $param; } if ($param = $this->getController()) { $params['controller'] = $param; } if ($param = $this->getAction()) { $params['action'] = $param; } $url = self::$_urlHelper->url( $params, $this->getRoute(), $this->getResetParams(), $this->_encode ); return $this->_hrefCache = $url; }
P4Cms_Navigation_Page_Mvc::getLabel | ( | ) |
Returns page label with support for macros.
{ return P4Cms_Navigation::expandMacros(parent::getLabel(), $this); }
P4Cms_Navigation_Page_Mvc::getTitle | ( | ) |
Returns page title with support for macros.
{ return P4Cms_Navigation::expandMacros(parent::getTitle(), $this); }
P4Cms_Navigation_Page_Mvc::setEncode | ( | $ | encode | ) |
Set whether to encode page href generated by getHref() method.
boolean | $encode | if true then page href will be encoded, otherwise page href will not be encoded |
{
$this->_encode = (bool) $encode;
$this->_hrefCache = null;
return $this;
}
P4Cms_Navigation_Page_Mvc::toArray | ( | ) |
Returns an array representation of the page.
{ return array_merge( parent::toArray(), array( 'label' => $this->_label, 'title' => $this->_title ) ); }
P4Cms_Navigation_Page_Mvc::$_encode = true [protected] |