public function getRenderedParameter($key, $escaper = null)
    {
        $subject = $this->getParameter($key);
        preg_match_all('/{{([a-zA-Z0-9\.\-\_]+)}}/', $subject, $matches);
        $parameterList = $matches[1];
        foreach ($parameterList as $parameterKey) {
            $val = $this->getParameter($parameterKey);
            if ($val) {
                if (is_callable($escaper)) {
                    $val = $escaper($val);
                }
                $subject = str_replace('{{'.$parameterKey.'}}', $val, $subject);
            } else {
                $subject = str_replace('{{'.$parameterKey.'}}', '', $subject);
            }
        }
        return $subject;
    }
public function getRenderedParameter($key, $escaper = null)
    {
        $subject = $this->getParameter($key);
        preg_match_all('/{{([a-zA-Z0-9\.\-\_]+)}}/', $subject, $matches);
        $parameterList = $matches[1];
        foreach ($parameterList as $parameterKey) {
            $val = $this->getParameter($parameterKey);
            if ($val) {
                if (is_callable($escaper)) {
                    $val = $escaper($val);
                }
                $subject = str_replace('{{'.$parameterKey.'}}', $val, $subject);
            } else {
                $subject = str_replace('{{'.$parameterKey.'}}', '', $subject);
            }
        }
        return $subject;
    }
public function getRenderedParameter ( $ key , $ escaper = null ) { $ subject = $ this -> getParameter ( $ key ) ; preg_match_all ( '/{{([a-zA-Z0-9\.\-\_]+)}}/' , $ subject , $ matches ) ; $ parameterList = $ matches [ 1 ] ; foreach ( $ parameterList as $ parameterKey ) { $ val = $ this -> getParameter ( $ parameterKey ) ; if ( $ val ) { if ( is_callable ( $ escaper ) ) { $ val = $ escaper ( $ val ) ; } $ subject = str_replace ( '{{' . $ parameterKey . '}}' , $ val , $ subject ) ; } else { $ subject = str_replace ( '{{' . $ parameterKey . '}}' , '' , $ subject ) ; } } return $ subject ; }
used to transform a value in a parameter.

ex :
$parameterList['foo'] = 'ls {{fileName}} {{bar}}';
$parameterList['fileName'] = '/tmp/titi';
// $parameterList['bar'] is undefined

=> $this->getRenderedParameter('foo', function ($str) { strtoupper($str); } );
Result : ls /TMP/TITI

@param $key
@param callable $escaper
@return mixed|null
used to transform a value in a parameter .