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_unregisterresource.php 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Smarty Method UnregisterResource
  4. *
  5. * Smarty::unregisterResource() method
  6. *
  7. * @package Smarty
  8. * @subpackage PluginsInternal
  9. * @author Uwe Tews
  10. */
  11. class Smarty_Internal_Method_UnregisterResource
  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::unregisterResource()
  23. * @link http://www.smarty.net/docs/en/api.unregister.resource.tpl
  24. *
  25. * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
  26. * @param string $type name of resource type
  27. *
  28. * @return \Smarty|\Smarty_Internal_Template
  29. */
  30. public function unregisterResource(Smarty_Internal_TemplateBase $obj, $type)
  31. {
  32. $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
  33. if (isset($smarty->registered_resources[$type])) {
  34. unset($smarty->registered_resources[$type]);
  35. }
  36. return $obj;
  37. }
  38. }