smarty_internal_undefined.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Smarty Method AppendByRef
  4. *
  5. * Smarty::appendByRef() method
  6. *
  7. * @package Smarty
  8. * @subpackage PluginsInternal
  9. * @author Uwe Tews
  10. */
  11. class Smarty_Internal_Undefined
  12. {
  13. /**
  14. * This function is executed automatically when a compiled or cached template file is included
  15. * - Decode saved properties from compiled template and cache files
  16. * - Check if compiled or cache file is valid
  17. *
  18. * @param \Smarty_Internal_Template $tpl
  19. * @param array $properties special template properties
  20. * @param bool $cache flag if called from cache file
  21. *
  22. * @return bool flag if compiled or cache file is valid
  23. */
  24. public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
  25. {
  26. if ($cache) {
  27. $tpl->cached->valid = false;
  28. } else {
  29. $tpl->mustCompile = true;
  30. }
  31. return false;
  32. }
  33. /**
  34. * Call error handler for undefined method
  35. *
  36. * @param string $name unknown method-name
  37. * @param array $args argument array
  38. *
  39. * @return mixed
  40. * @throws SmartyException
  41. */
  42. public function __call($name, $args)
  43. {
  44. throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method");
  45. }
  46. }