Files
smarty/libs/sysplugins/internal.compile_block.php

39 lines
1.1 KiB
PHP
Raw Normal View History

<?php
/**
2009-04-24 19:59:51 +00:00
* Smarty Internal Plugin Compile Block
*
* Compiles the {block} tag
*
* @package Smarty
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Compile Block Class
*/
class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
/**
* Compiles code for the {block} tag
*
* @param array $args array with attributes from parser
* @param object $compiler compiler object
2009-04-24 19:59:51 +00:00
* @return boolean true
*/
public function compile($args, $compiler)
{
$this->compiler = $compiler;
$this->required_attributes = array('name');
$this->optional_attributes = array('assign');
// check and get attributes
$_attr = $this->_get_attributes($args);
2009-03-28 12:20:53 +00:00
$save = array($_attr, $compiler->template->extracted_compiled_code, $compiler->template->extract_code);
$this->_open_tag('block', $save);
$compiler->template->extract_code = true;
$compiler->template->extracted_compiled_code = '';
$compiler->template->has_code = false;
return true;
}
}
?>