public function replace($string)
    {
        $nestLevel = 1;
        do {
            $originalString = $string;
            $nestLevel++;
            $string = $this->_substitutor->replace($string);
        } while (($originalString != $string) && ($nestLevel <= $this->_maxNestLevel));
        return $string;
    }
public function replace($string)
    {
        $nestLevel = 1;
        do {
            $originalString = $string;
            $nestLevel++;
            $string = $this->_substitutor->replace($string);
        } while (($originalString != $string) && ($nestLevel <= $this->_maxNestLevel));
        return $string;
    }
public function replace ( $ string ) { $ nestLevel = 1 ; do { $ originalString = $ string ; $ nestLevel ++ ; $ string = $ this -> _substitutor -> replace ( $ string ) ; } while ( ( $ originalString != $ string ) && ( $ nestLevel <= $ this -> _maxNestLevel ) ) ; return $ string ; }
Use StrSubstitutor class recursively

Example:
<code>
$strSubstitutor = new RecursiveStrSubstitutor(array('HOST' => '{{URL}}', 'URL' => 'website.foo'));
$substituted = $strSubstitutor->replace('Connect with {{HOST}}');
</code>
Result:
<code>
Connect with website.foo
</code>

@param string $string
@return mixed
Use StrSubstitutor class recursively