public function talesChainPart(PHPTAL_Php_TalesChainExecutor $executor, $exp, $islast) { $codewriter = $executor->getCodeWriter(); $escape = !($this->_echoType == PHPTAL_Php_Attribute::ECHO_STRUCTURE); $exp = $codewriter->getTranslatorReference() . "->translate({$exp}, " . ($escape ? 'true' : 'false') . ')'; if (!$islast) { $var = $codewriter->createTempVariable(); $executor->doIf('!phptal_isempty(' . $var . ' = ' . $exp . ')'); $codewriter->pushCode("echo {$var}"); $codewriter->recycleTempVariable($var); } else { $executor->doElse(); $codewriter->pushCode("echo {$exp}"); } }
public function talesChainDefaultKeyword(PHPTAL_Php_TalesChainExecutor $executor) { $executor->doElse(); $this->bufferizeContent(); $executor->breakChain(); }
public function talesChainDefaultKeyword(PHPTAL_Php_TalesChainExecutor $executor) { $codewriter = $executor->getCodeWriter(); $executor->doElse(); $attr_str = $this->_default_escaped !== false ? ' ' . $this->_attribute . '=' . $codewriter->quoteAttributeValue($this->_default_escaped) : ''; // do not print attribute $codewriter->doSetVar($this->_attkey, $codewriter->str($attr_str)); $executor->breakChain(); }
public function talesChainDefaultKeyword(PHPTAL_Php_TalesChainExecutor $executor) { if (!$this->_chainPartGenerated) { throw new PHPTAL_TemplateException("Invalid expression in tal:define", $this->phpelement->getSourceFile(), $this->phpelement->getSourceLine()); } $executor->doElse(); $this->bufferizeContent($executor->getCodeWriter()); $executor->breakChain(); }
public function talesChainPart(PHPTAL_Php_TalesChainExecutor $executor, $exp, $islast) { if (!$islast) { $var = $executor->getCodeWriter()->createTempVariable(); $executor->doIf('!phptal_isempty(' . $var . ' = ' . $exp . ')'); $this->doEchoAttribute($executor->getCodeWriter(), $var); $executor->getCodeWriter()->recycleTempVariable($var); } else { $executor->doElse(); $this->doEchoAttribute($executor->getCodeWriter(), $exp); } }
public function talesChainDefaultKeyword(PHPTAL_Php_TalesChainExecutor $executor) { $executor->doElse(); $code = $this->_default !== false ? "' {$this->_attribute}=\"" . str_replace("'", '\\\'', $this->_default) . "\"'" : '\'\''; // do not print attribute $this->tag->generator->doSetVar($this->_attkey, $code); $executor->breakChain(); }
public function talesChainDefaultKeyword(PHPTAL_Php_TalesChainExecutor $executor) { $executor->doElse(); $this->generateDefault($executor->getCodeWriter()); $executor->breakChain(); }