Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2809 rexy 1
<?php
2
 
3
/**
4
 * Smarty Method ClearAssign
5
 *
6
 * Smarty::clearAssign() method
7
 *
8
 * @package    Smarty
9
 * @subpackage PluginsInternal
10
 * @author     Uwe Tews
11
 */
12
class Smarty_Internal_Method_ClearAssign
13
{
14
    /**
15
     * Valid for all objects
16
     *
17
     * @var int
18
     */
19
    public $objMap = 7;
20
 
21
    /**
22
     * clear the given assigned template variable(s).
23
     *
24
     * @api  Smarty::clearAssign()
25
     * @link http://www.smarty.net/docs/en/api.clear.assign.tpl
26
     *
27
     * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data
28
     * @param string|array                                            $tpl_var the template variable(s) to clear
29
     *
30
     * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
31
     */
32
    public function clearAssign(Smarty_Internal_Data $data, $tpl_var)
33
    {
34
        if (is_array($tpl_var)) {
35
            foreach ($tpl_var as $curr_var) {
36
                unset($data->tpl_vars[ $curr_var ]);
37
            }
38
        } else {
39
            unset($data->tpl_vars[ $tpl_var ]);
40
        }
41
        return $data;
42
    }
43
}