"Fossies" - the Fresh Open Source Software Archive

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