Files
smarty/libs/sysplugins/internal.compile_captureclose.php
Uwe.Tews 0e68cdd9d2 - replace internal "eval()" calls by "include" during rendering process
- speed improvment for templates which have included subtemplates
    the compiled code of included templates is merged into the compiled code of the parent template
- added logical operator "xor" for {if} tag
- changed parameter ordering for Smarty2 BC
    fetch($template, $cache_id = null, $compile_id = null, $parent = null)
    display($template, $cache_id = null, $compile_id = null, $parent = null)
    createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
- property resource_char_set is now replaced by constant SMARTY_RESOURCE_CHAR_SET
- fixed handling of classes in registered blocks
- speed improvement of lexer on text sections
2009-09-19 13:22:32 +00:00

39 lines
1.1 KiB
PHP

<?php
/**
* Smarty Internal Plugin Compile Capture Close
*
* Compiles the {/capture} tag
* @package Smarty
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Compile CaptureClose Class
*/
class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
/**
* Compiles code for the {/capture} tag
*
* @param array $args array with attributes from parser
* @param object $compiler compiler object
* @return string compiled code
*/
public function compile($args, $compiler)
{
$this->compiler = $compiler;
// check and get attributes
$_attr = $this->_get_attributes($args);
$saved_attr = $this->_close_tag(array('capture'));
$_output = "<?php ";
if (isset($saved_attr[1])) {
$_output .= " \$_smarty_tpl->assign($saved_attr[1], ob_get_contents());";
}
$_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$saved_attr[0]]=ob_get_clean(); ?>\n";
return $_output;
}
}
?>