classes/Text.php
public static function render($t,$v=null){
    if (Options::get('core.text.replace_empties', true)) {
      $replacer = function($c) use ($v){
        return Structure::fetch(trim($c[1]), $v);
      };
    } else {
      $replacer = function($c) use ($v){
        return Structure::fetch(trim($c[1]), $v) ?: $c[0];
      };
    }

    return preg_replace_callback("(\{\{([^}]+)\}\})S",$replacer,$t);
  }
public static function render($t,$v=null){
    if (Options::get('core.text.replace_empties', true)) {
      $replacer = function($c) use ($v){
        return Structure::fetch(trim($c[1]), $v);
      };
    } else {
      $replacer = function($c) use ($v){
        return Structure::fetch(trim($c[1]), $v) ?: $c[0];
      };
    }

    return preg_replace_callback("(\{\{([^}]+)\}\})S",$replacer,$t);
  }
public static function render ( $ t , $ v = null ) { if ( Options :: get ( 'core.text.replace_empties' , true ) ) { $ replacer = function ( $ c ) use ( $ v ) { return Structure :: fetch ( trim ( $ c [ 1 ] ) , $ v ) ; } ; } else { $ replacer = function ( $ c ) use ( $ v ) { return Structure :: fetch ( trim ( $ c [ 1 ] ) , $ v ) ? : $ c [ 0 ] ; } ; } return preg_replace_callback ( "(\{\{([^}]+)\}\})S" , $ replacer , $ t ) ; }
Fast string templating.
Uses a Twig-like syntax.

@example
echo Text::render('Your IP is : {{ server.REMOTE_HOST }}',array('server' => $_SERVER));

@author Stefano Azzolini <stefano.azzolini@caffeinalab.com>
@access public
@static
@param mixed $t  The text template
@param mixed $v (default: null)  The array of values exposed in template.
@return string
Fast string templating . Uses a Twig - like syntax .