Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2809 rexy 1
<?php
2
 
3
/**
4
 * Smarty Method AddDefaultModifiers
5
 *
6
 * Smarty::addDefaultModifiers() method
7
 *
8
 * @package    Smarty
9
 * @subpackage PluginsInternal
10
 * @author     Uwe Tews
11
 */
12
class Smarty_Internal_Method_AddDefaultModifiers
13
{
14
    /**
15
     * Valid for Smarty and template object
16
     *
17
     * @var int
18
     */
19
    public $objMap = 3;
20
 
21
    /**
22
     * Add default modifiers
23
     *
24
     * @api Smarty::addDefaultModifiers()
25
     *
26
     * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
27
     * @param array|string                                                    $modifiers modifier or list of modifiers
28
     *                                                                                   to add
29
     *
30
     * @return \Smarty|\Smarty_Internal_Template
31
     */
32
    public function addDefaultModifiers(Smarty_Internal_TemplateBase $obj, $modifiers)
33
    {
34
        $smarty = $obj->_getSmartyObj();
35
        if (is_array($modifiers)) {
36
            $smarty->default_modifiers = array_merge($smarty->default_modifiers, $modifiers);
37
        } else {
38
            $smarty->default_modifiers[] = $modifiers;
39
        }
40
        return $obj;
41
    }
42
}