You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smarty_internal_method_registercacheresource.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Smarty Method RegisterCacheResource
  4. *
  5. * Smarty::registerCacheResource() method
  6. *
  7. * @package Smarty
  8. * @subpackage PluginsInternal
  9. * @author Uwe Tews
  10. */
  11. class Smarty_Internal_Method_RegisterCacheResource
  12. {
  13. /**
  14. * Valid for Smarty and template object
  15. *
  16. * @var int
  17. */
  18. public $objMap = 3;
  19. /**
  20. * Registers a resource to fetch a template
  21. *
  22. * @api Smarty::registerCacheResource()
  23. * @link http://www.smarty.net/docs/en/api.register.cacheresource.tpl
  24. *
  25. * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
  26. * @param string $name name of resource type
  27. * @param \Smarty_CacheResource $resource_handler
  28. *
  29. * @return \Smarty|\Smarty_Internal_Template
  30. */
  31. public function registerCacheResource(Smarty_Internal_TemplateBase $obj, $name, Smarty_CacheResource $resource_handler)
  32. {
  33. $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
  34. $smarty->registered_cache_resources[$name] = $resource_handler;
  35. return $obj;
  36. }
  37. }