/** * php: modifier. * * Transform the expression into a regular PHP expression. */ public static function php($src) { return PHPTAL_Php_Transformer::transform($src, '$ctx->'); }
/** * 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->'); }
/** * 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->'); }
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)); }