"Fossies" - the Fresh Open Source Software Archive

Member "smarty-3.1.34/libs/sysplugins/smarty_internal_method_getautoloadfilters.php" (28 Feb 2019, 1353 Bytes) of package /linux/www/smarty-3.1.34.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "smarty_internal_method_getautoloadfilters.php" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.1.32_vs_3.1.33.

    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      * Get autoload filters
   16      *
   17      * @api Smarty::getAutoloadFilters()
   18      *
   19      * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
   20      * @param string                                                          $type type of filter to get auto loads
   21      *                                                                              for. Defaults to all autoload
   22      *                                                                              filters
   23      *
   24      * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type
   25      *                was specified
   26      * @throws \SmartyException
   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 }