3 * Smarty Internal Plugin Compile Make_Nocache
4 * Compiles the {make_nocache} tag
12 * Smarty Internal Plugin Compile Make_Nocache Class
15 * @subpackage Compiler
17 class Smarty_Internal_Compile_Make_Nocache extends Smarty_Internal_CompileBase
20 * Attribute definition: Overwrites base class.
23 * @see Smarty_Internal_CompileBase
25 public $option_flags = array();
28 * Array of names of required attribute required by tag
32 public $required_attributes = array('var');
35 * Shorttag attribute order defined by its names
39 public $shorttag_order = array('var');
42 * Compiles code for the {make_nocache} tag
44 * @param array $args array with attributes from parser
45 * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
46 * @param array $parameter array with compilation parameter
48 * @return string compiled code
49 * @throws \SmartyCompilerException
51 public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
53 // check and get attributes
54 $_attr = $this->getAttributes($compiler, $args);
55 if ($compiler->template->caching) {
56 $output = "<?php \$_smarty_tpl->smarty->ext->_make_nocache->save(\$_smarty_tpl, {$_attr[ 'var' ]});\n?>\n";
57 $compiler->has_code = true;
58 $compiler->suppressNocacheProcessing = true;