Commit 6ea8a477 authored by guilhermeblanco's avatar guilhermeblanco

Split of methods in _parseTemplate in 0.10 and trunk

parent d6ec5d6d
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment