Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2809 rexy 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
}