|
1 <?php |
|
2 /** |
|
3 * Smarty Internal Plugin Compile Nocache |
|
4 * Compiles the {nocache} {/nocache} tags. |
|
5 * |
|
6 * @package Smarty |
|
7 * @subpackage Compiler |
|
8 * @author Uwe Tews |
|
9 */ |
|
10 |
|
11 /** |
|
12 * Smarty Internal Plugin Compile Nocache Class |
|
13 * |
|
14 * @package Smarty |
|
15 * @subpackage Compiler |
|
16 */ |
|
17 class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase { |
|
18 /** |
|
19 * Array of names of valid option flags |
|
20 * |
|
21 * @var array |
|
22 */ |
|
23 public $option_flags = array(); |
|
24 |
|
25 /** |
|
26 * Compiles code for the {nocache} tag |
|
27 * This tag does not generate compiled output. It only sets a compiler flag. |
|
28 * |
|
29 * @param array $args array with attributes from parser |
|
30 * @param object $compiler compiler object |
|
31 * |
|
32 * @return bool |
|
33 */ |
|
34 public function compile($args, $compiler) { |
|
35 $_attr = $this->getAttributes($compiler, $args); |
|
36 $this->openTag($compiler, 'nocache', array($compiler->nocache)); |
|
37 // enter nocache mode |
|
38 $compiler->nocache = true; |
|
39 // this tag does not return compiled code |
|
40 $compiler->has_code = false; |
|
41 |
|
42 return true; |
|
43 } |
|
44 } |
|
45 |
|
46 /** |
|
47 * Smarty Internal Plugin Compile Nocacheclose Class |
|
48 * |
|
49 * @package Smarty |
|
50 * @subpackage Compiler |
|
51 */ |
|
52 class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase { |
|
53 /** |
|
54 * Compiles code for the {/nocache} tag |
|
55 * This tag does not generate compiled output. It only sets a compiler flag. |
|
56 * |
|
57 * @param array $args array with attributes from parser |
|
58 * @param object $compiler compiler object |
|
59 * |
|
60 * @return bool |
|
61 */ |
|
62 public function compile($args, $compiler) { |
|
63 $_attr = $this->getAttributes($compiler, $args); |
|
64 // leave nocache mode |
|
65 list($compiler->nocache) = $this->closeTag($compiler, array('nocache')); |
|
66 // this tag does not return compiled code |
|
67 $compiler->has_code = false; |
|
68 |
|
69 return true; |
|
70 } |
|
71 } |