Esempio n. 1
0
 /**
  * php: modifier.
  *
  * Transform the expression into a regular PHP expression.
  */
 public static function php($src)
 {
     return PHPTAL_Php_Transformer::transform($src, '$ctx->');
 }
Esempio n. 2
0
/**
 * helper: custom PHPTAL modifier
 *
 * @param string $src
 * @param string $nothrow
 * @return string
 */
function phptal_tales_helper($src, $nothrow)
{
    $src = 'this->' . trim($src);
    return PHPTAL_Php_Transformer::transform($src, '$ctx->');
}
Esempio n. 3
0
 /**
  * php: modifier.
  *
  * Transform the expression into a regular PHP expression.
  */
 public static function php($src)
 {
     require_once PHPTAL_DIR . 'PHPTAL/Php/Transformer.php';
     return PHPTAL_Php_Transformer::transform($src, '$ctx->');
 }
Esempio n. 4
0
 function testTransformInString()
 {
     $src = '"do not tranform this ge string lt eq"';
     $this->assertEquals($src, PHPTAL_Php_Transformer::transform($src));
     $src = "'do not tranform this ge string lt eq'";
     $this->assertEquals($src, PHPTAL_Php_Transformer::transform($src));
 }