Exemplo n.º 1
0
 public function before(PHPTAL_Php_CodeWriter $codewriter)
 {
     $this->tmp_var = $codewriter->createTempVariable();
     $codewriter->doSetVar($this->tmp_var, $codewriter->interpolateTalesVarsInString($this->expression));
     $codewriter->doIf('$ctx->hasSlot(' . $this->tmp_var . ')');
     $codewriter->pushCode('$ctx->echoSlot(' . $this->tmp_var . ')');
     $codewriter->doElse();
 }
Exemplo n.º 2
0
 public function before(PHPTAL_Php_CodeWriter $codewriter)
 {
     // ensure a domain stack exists or create it
     $codewriter->doIf('!isset($_i18n_domains)');
     $codewriter->pushCode('$_i18n_domains = array()');
     $codewriter->doEnd('if');
     $expression = $codewriter->interpolateTalesVarsInString($this->expression);
     // push current domain and use new domain
     $code = '$_i18n_domains[] = ' . $codewriter->getTranslatorReference() . '->useDomain(' . $expression . ')';
     $codewriter->pushCode($code);
 }