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_clearconfig.php 974B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Smarty Method ClearConfig
  4. *
  5. * Smarty::clearConfig() method
  6. *
  7. * @package Smarty
  8. * @subpackage PluginsInternal
  9. * @author Uwe Tews
  10. */
  11. class Smarty_Internal_Method_ClearConfig
  12. {
  13. /**
  14. * Valid for all objects
  15. *
  16. * @var int
  17. */
  18. public $objMap = 7;
  19. /**
  20. * clear a single or all config variables
  21. *
  22. * @api Smarty::clearConfig()
  23. * @link http://www.smarty.net/docs/en/api.clear.config.tpl
  24. *
  25. * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data
  26. * @param string|null $name variable name or null
  27. *
  28. * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
  29. */
  30. public function clearConfig(Smarty_Internal_Data $data, $name = null)
  31. {
  32. if (isset($name)) {
  33. unset($data->config_vars[$name]);
  34. } else {
  35. $data->config_vars = array();
  36. }
  37. return $data;
  38. }
  39. }