* @author Kornel LesiƄski * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License * @version SVN: $Id: DefineSlot.php 706 2009-09-01 11:24:39Z kornel $ * @link http://phptal.org/ */ /** * METAL Specification 1.0 * * argument ::= Name * * Example: * * * * *
Links
* A Link *
* * PHPTAL: (access to slots may be renamed) * * * * * * slots->links)): ? > * slots->links ? > * * *
Links
* A Link *
* * * @package PHPTAL * @subpackage Php.attribute.metal * @author Laurent Bedubourg */ class PHPTAL_Php_Attribute_METAL_DefineSlot extends PHPTAL_Php_Attribute { public function before(PHPTAL_Php_CodeWriter $codewriter) { $codewriter->doIf('$ctx->hasSlot('.$codewriter->str($this->expression).')'); $codewriter->pushCode('$ctx->echoSlot('.$codewriter->str($this->expression).')'); $codewriter->doElse(); } public function after(PHPTAL_Php_CodeWriter $codewriter) { $codewriter->doEnd('if'); } }