您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

smarty_internal_compile_nocache.php 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. * Smarty Internal Plugin Compile Nocache Class
  12. *
  13. * @package Smarty
  14. * @subpackage Compiler
  15. */
  16. class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase
  17. {
  18. /**
  19. * Array of names of valid option flags
  20. *
  21. * @var array
  22. */
  23. public $option_flags = array();
  24. /**
  25. * Compiles code for the {nocache} tag
  26. * This tag does not generate compiled output. It only sets a compiler flag.
  27. *
  28. * @param array $args array with attributes from parser
  29. * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
  30. *
  31. * @return bool
  32. */
  33. public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
  34. {
  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. return true;
  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. * This tag does not generate compiled output. It only sets a compiler flag.
  55. *
  56. * @param array $args array with attributes from parser
  57. * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
  58. *
  59. * @return bool
  60. */
  61. public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
  62. {
  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. return true;
  69. }
  70. }