Split of methods in _parseTemplate in 0.10 and trunk
This commit is contained in:
parent
d6ec5d6df2
commit
6ea8a47773
@ -415,6 +415,24 @@ class Doctrine_Pager_Layout
|
||||
* @return string
|
||||
*/
|
||||
protected function _parseTemplate($options = array())
|
||||
{
|
||||
$str = $this->_parseUrlTemplate($options);
|
||||
$replacements = $this->_parseReplacementsTemplate($options);
|
||||
|
||||
return strtr($str, $replacements);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _parseUrlTemplate
|
||||
*
|
||||
* Processes the url mask to return the correct template depending of the options sent.
|
||||
* Already process the mask replacements assigned.
|
||||
*
|
||||
* @param $options Optional parameters to be applied in template and url mask
|
||||
* @return string
|
||||
*/
|
||||
protected function _parseUrlTemplate($options = array())
|
||||
{
|
||||
$str = '';
|
||||
|
||||
@ -428,6 +446,20 @@ class Doctrine_Pager_Layout
|
||||
$str = $this->_parseMaskReplacements($this->getTemplate());
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _parseUrl
|
||||
*
|
||||
* Process the url mask of a given page and return the processed url
|
||||
*
|
||||
* @param $options Optional parameters to be applied in template and url mask
|
||||
* @return string
|
||||
*/
|
||||
protected function _parseReplacementsTemplate($options = array())
|
||||
{
|
||||
// Defining "url" options index to allow {%url} mask
|
||||
$options['url'] = $this->_parseUrl($options);
|
||||
|
||||
@ -437,7 +469,7 @@ class Doctrine_Pager_Layout
|
||||
$replacements['{%'.$k.'}'] = $v;
|
||||
}
|
||||
|
||||
return strtr($str, $replacements);
|
||||
return $replacements;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user