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

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Smarty Method UnregisterObject
  4. *
  5. * Smarty::unregisterObject() method
  6. *
  7. * @package Smarty
  8. * @subpackage PluginsInternal
  9. * @author Uwe Tews
  10. */
  11. class Smarty_Internal_Method_UnregisterObject
  12. {
  13. /**
  14. * Valid for Smarty and template object
  15. *
  16. * @var int
  17. */
  18. public $objMap = 3;
  19. /**
  20. * Registers plugin to be used in templates
  21. *
  22. * @api Smarty::unregisterObject()
  23. * @link http://www.smarty.net/docs/en/api.unregister.object.tpl
  24. *
  25. * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
  26. * @param string $object_name name of object
  27. *
  28. * @return \Smarty|\Smarty_Internal_Template
  29. */
  30. public function unregisterObject(Smarty_Internal_TemplateBase $obj, $object_name)
  31. {
  32. $smarty = $obj->_getSmartyObj();
  33. if (isset($smarty->registered_objects[ $object_name ])) {
  34. unset($smarty->registered_objects[ $object_name ]);
  35. }
  36. return $obj;
  37. }
  38. }