PHP Class Ouzo\Utilities\RecursiveStrSubstitutor

Afficher le fichier Open project: letsdrink/ouzo Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

replace() public méthode

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
Résultat mixed