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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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,
  32. Smarty_CacheResource $resource_handler)
  33. {
  34. $smarty = $obj->_getSmartyObj();
  35. $smarty->registered_cache_resources[ $name ] = $resource_handler;
  36. return $obj;
  37. }
  38. }