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: /**
20: * Array of names of valid option flags
21: *
22: * @var array
23: */
24: public $option_flags = array();
25:
26: /**
27: * Compiles code for the {nocache} tag
28: * This tag does not generate compiled output. It only sets a compiler flag.
29: *
30: * @param array $args array with attributes from parser
31: * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
32: *
33: * @return bool
34: */
35: public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
36: {
37: $_attr = $this->getAttributes($compiler, $args);
38: $this->openTag($compiler, 'nocache', array($compiler->nocache));
39: // enter nocache mode
40: $compiler->nocache = true;
41: // this tag does not return compiled code
42: $compiler->has_code = false;
43: return true;
44: }
45: }
46:
47: /**
48: * Smarty Internal Plugin Compile Nocacheclose Class
49: *
50: * @package Smarty
51: * @subpackage Compiler
52: */
53: class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase
54: {
55: /**
56: * Compiles code for the {/nocache} tag
57: * This tag does not generate compiled output. It only sets a compiler flag.
58: *
59: * @param array $args array with attributes from parser
60: * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
61: *
62: * @return bool
63: */
64: public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
65: {
66: $_attr = $this->getAttributes($compiler, $args);
67: // leave nocache mode
68: list($compiler->nocache) = $this->closeTag($compiler, array('nocache'));
69: // this tag does not return compiled code
70: $compiler->has_code = false;
71: return true;
72: }
73: }
74: