tag->generator->doIf('!isset($__i18n_sources)'); $this->tag->generator->pushCode('$__i18n_sources = array()'); $this->tag->generator->end(); // push current source and use new one $code = '$__i18n_sources[] = $_translator->setSource(\'%s\')'; $code = sprintf($code, $this->expression); $this->tag->generator->pushCode($code); } public function end() { // restore source $code = '$_translator->setSource(array_pop($__i18n_sources))'; $this->tag->generator->pushCode($code); } } ?>