smarty_internal_compile_nocache.php (1946B)
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 object $compiler compiler object 32 * 33 * @return bool 34 */ 35 public function compile($args, $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 44 return true; 45 } 46 } 47 48 /** 49 * Smarty Internal Plugin Compile Nocacheclose Class 50 * 51 * @package Smarty 52 * @subpackage Compiler 53 */ 54 class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase 55 { 56 /** 57 * Compiles code for the {/nocache} tag 58 * This tag does not generate compiled output. It only sets a compiler flag. 59 * 60 * @param array $args array with attributes from parser 61 * @param object $compiler compiler object 62 * 63 * @return bool 64 */ 65 public function compile($args, $compiler) 66 { 67 $_attr = $this->getAttributes($compiler, $args); 68 // leave nocache mode 69 list($compiler->nocache) = $this->closeTag($compiler, array('nocache')); 70 // this tag does not return compiled code 71 $compiler->has_code = false; 72 73 return true; 74 } 75 }