1 <?php
3 /**
4 * Smarty Internal Plugin Compile Nocache
5 *
6 * Compiles the {nocache} {/nocache} tags
7 * @package Smarty
8 * @subpackage Compiler
9 * @author Uwe Tews
10 */
12 /**
13 * Smarty Internal Plugin Compile Nocache Class
14 */
15 class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase {
16 /**
17 * Compiles code for the {nocache} tag
18 *
19 * This tag does not generate compiled output. It only sets a compiler flag
20 * @param array $args array with attributes from parser
21 * @param object $compiler compiler object
22 * @return string compiled code
23 */
24 public function compile($args, $compiler)
25 {
26 $this->compiler = $compiler;
27 $_attr = $this->_get_attributes($args);
28 if ($_attr['nocache'] === true) {
29 $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);
30 }
31 // enter nocache mode
32 $this->compiler->nocache = true;
33 // this tag does not return compiled code
34 $this->compiler->has_code = false;
35 return true;
36 }
37 }
39 /**
40 * Smarty Internal Plugin Compile Nocacheclose Class
41 */
42 class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase {
43 /**
44 * Compiles code for the {/nocache} tag
45 *
46 * This tag does not generate compiled output. It only sets a compiler flag
47 * @param array $args array with attributes from parser
48 * @param object $compiler compiler object
49 * @return string compiled code
50 */
51 public function compile($args, $compiler)
52 {
53 $this->compiler = $compiler;
54 $_attr = $this->_get_attributes($args);
55 // leave nocache mode
56 $this->compiler->nocache = false;
57 // this tag does not return compiled code
58 $this->compiler->has_code = false;
59 return true;
60 }
61 }
63 ?>