//
require_once PHPTAL_DIR.'PHPTAL/Php/Attribute.php';
// METAL Specification 1.0
//
// argument ::= Name
//
// Example:
//
//
//
// PHPTAL: (access to slots may be renamed)
//
//
//
// | Links |
//
// slots->links)): ? >
// slots->links ? >
//
// |
// A Link
// |
//
//
//
/**
* @package phptal.php.attribute.metal
* @author Laurent Bedubourg
*/
class PHPTAL_Php_Attribute_METAL_DefineSlot extends PHPTAL_Php_Attribute
{
public function start()
{
$cond = sprintf('$ctx->hasSlot("%s")', $this->expression);
$this->tag->generator->doIf($cond);
$code = sprintf('getSlot("%s") ?>', $this->expression);
$this->tag->generator->pushHtml($code);
$this->tag->generator->doElse();
}
public function end()
{
$this->tag->generator->doEnd();
}
}
?>