smarty_internal_compile_nocache.php 1.6 KB

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