PHP Class Ouzo\Utilities\RecursiveStrSubstitutor

Show file Open project: letsdrink/ouzo Class Usage Examples

Public Methods

Method Description
__construct ( array $values = [], null | string $default = null, integer $maxNestLevel = 10 ) Creates recursive substitutor
replace ( string $string ) : mixed Use StrSubstitutor class recursively

Method Details

__construct() public method

Creates recursive substitutor
public __construct ( array $values = [], null | string $default = null, integer $maxNestLevel = 10 )
$values array
$default null | string
$maxNestLevel integer

replace() public method

Example: $strSubstitutor = new RecursiveStrSubstitutor(array('HOST' => '{{URL}}', 'URL' => 'website.foo')); $substituted = $strSubstitutor->replace('Connect with {{HOST}}'); Result: Connect with website.foo
public replace ( string $string ) : mixed
$string string
return mixed