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