Changeset 3874

Show
Ignore:
Timestamp:
02/21/08 14:12:01 (17 months ago)
Author:
guilhermeblanco
Message:

Split of methods in _parseTemplate in 0.10 and trunk

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Pager/Layout.php

    r3870 r3874  
    417417    protected function _parseTemplate($options = array()) 
    418418    { 
     419        $str = $this->_parseUrlTemplate($options); 
     420        $replacements = $this->_parseReplacementsTemplate($options); 
     421 
     422        return strtr($str, $replacements); 
     423    } 
     424 
     425 
     426    /** 
     427     * _parseUrlTemplate 
     428     * 
     429     * Processes the url mask to return the correct template depending of the options sent. 
     430     * Already process the mask replacements assigned. 
     431     * 
     432     * @param $options    Optional parameters to be applied in template and url mask 
     433     * @return string 
     434     */ 
     435    protected function _parseUrlTemplate($options = array()) 
     436    { 
    419437        $str = ''; 
    420438 
     
    429447        } 
    430448 
     449        return $str; 
     450    } 
     451 
     452 
     453    /** 
     454     * _parseUrl 
     455     * 
     456     * Process the url mask of a given page and return the processed url 
     457     * 
     458     * @param $options    Optional parameters to be applied in template and url mask 
     459     * @return string 
     460     */ 
     461    protected function _parseReplacementsTemplate($options = array()) 
     462    { 
    431463        // Defining "url" options index to allow {%url} mask 
    432464        $options['url'] = $this->_parseUrl($options); 
     
    438470        } 
    439471 
    440         return strtr($str, $replacements); 
     472        return $replacements; 
    441473    } 
    442474 
  • trunk/lib/Doctrine/Pager/Layout.php

    r3872 r3874  
    417417    protected function _parseTemplate($options = array()) 
    418418    { 
     419        $str = $this->_parseUrlTemplate($options); 
     420        $replacements = $this->_parseReplacementsTemplate($options); 
     421 
     422        return strtr($str, $replacements); 
     423    } 
     424 
     425 
     426    /** 
     427     * _parseUrlTemplate 
     428     * 
     429     * Processes the url mask to return the correct template depending of the options sent. 
     430     * Already process the mask replacements assigned. 
     431     * 
     432     * @param $options    Optional parameters to be applied in template and url mask 
     433     * @return string 
     434     */ 
     435    protected function _parseUrlTemplate($options = array()) 
     436    { 
    419437        $str = ''; 
    420438 
     
    429447        } 
    430448 
     449        return $str; 
     450    } 
     451 
     452 
     453    /** 
     454     * _parseUrl 
     455     * 
     456     * Process the url mask of a given page and return the processed url 
     457     * 
     458     * @param $options    Optional parameters to be applied in template and url mask 
     459     * @return string 
     460     */ 
     461    protected function _parseReplacementsTemplate($options = array()) 
     462    { 
    431463        // Defining "url" options index to allow {%url} mask 
    432464        $options['url'] = $this->_parseUrl($options); 
     
    438470        } 
    439471 
    440         return strtr($str, $replacements); 
     472        return $replacements; 
    441473    } 
    442474