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