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_getautoloadfilters.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Smarty Method GetAutoloadFilters
  4. *
  5. * Smarty::getAutoloadFilters() method
  6. *
  7. * @package Smarty
  8. * @subpackage PluginsInternal
  9. * @author Uwe Tews
  10. */
  11. class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters
  12. {
  13. /**
  14. * Get autoload filters
  15. *
  16. * @api Smarty::getAutoloadFilters()
  17. *
  18. * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
  19. * @param string $type type of filter to get auto loads
  20. * for. Defaults to all autoload
  21. * filters
  22. *
  23. * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type
  24. * was specified
  25. */
  26. public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null)
  27. {
  28. $smarty = isset($obj->smarty) ? $obj->smarty : $obj;
  29. if ($type !== null) {
  30. $this->_checkFilterType($type);
  31. return isset($smarty->autoload_filters[$type]) ? $smarty->autoload_filters[$type] : array();
  32. }
  33. return $smarty->autoload_filters;
  34. }
  35. }