]> git.mxchange.org Git - friendica.git/blob - vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_assignbyref.php
Merge pull request #4233 from MrPetovan/task/4116-move-smarty-to-composer
[friendica.git] / vendor / smarty / smarty / libs / sysplugins / smarty_internal_method_assignbyref.php
1 <?php
2
3 /**
4  * Smarty Method AssignByRef
5  *
6  * Smarty::assignByRef() method
7  *
8  * @package    Smarty
9  * @subpackage PluginsInternal
10  * @author     Uwe Tews
11  */
12 class Smarty_Internal_Method_AssignByRef
13 {
14
15     /**
16      * assigns values to template variables by reference
17      *
18      * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data
19      * @param string                                                  $tpl_var the template variable name
20      * @param                                                         $value
21      * @param  boolean                                                $nocache if true any output of this variable will be not cached
22      *
23      * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
24      */
25     public function assignByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $nocache)
26     {
27         if ($tpl_var != '') {
28             $data->tpl_vars[ $tpl_var ] = new Smarty_Variable(null, $nocache);
29             $data->tpl_vars[ $tpl_var ]->value = &$value;
30             if ($data->_isTplObj() && $data->scope) {
31                 $data->ext->_updateScope->_updateScope($data, $tpl_var);
32             }
33         }
34         return $data;
35     }
36 }