2009-03-22 16:09:05 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2009-04-24 19:59:51 +00:00
|
|
|
* Smarty Internal Plugin Compile Block
|
2009-03-22 16:09:05 +00:00
|
|
|
*
|
|
|
|
* 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
|
2009-03-22 16:09:05 +00:00
|
|
|
*/
|
|
|
|
public function compile($args, $compiler)
|
|
|
|
{
|
|
|
|
$this->compiler = $compiler;
|
|
|
|
$this->required_attributes = array('name');
|
2009-04-12 05:40:30 +00:00
|
|
|
$this->optional_attributes = array('assign');
|
2009-03-22 16:09:05 +00:00
|
|
|
// 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);
|
2009-03-22 16:09:05 +00:00
|
|
|
$compiler->template->extract_code = true;
|
|
|
|
$compiler->template->extracted_compiled_code = '';
|
|
|
|
$compiler->template->has_code = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|