You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smarty_internal_method_assignbyref.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Smarty Method AssignByRef
  4. *
  5. * Smarty::assignByRef() method
  6. *
  7. * @package Smarty
  8. * @subpackage PluginsInternal
  9. * @author Uwe Tews
  10. */
  11. class Smarty_Internal_Method_AssignByRef
  12. {
  13. /**
  14. * assigns values to template variables by reference
  15. *
  16. * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data
  17. * @param string $tpl_var the template variable name
  18. * @param $value
  19. * @param boolean $nocache if true any output of this variable will be not cached
  20. *
  21. * @return \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty
  22. */
  23. public function assignByRef(Smarty_Internal_Data $data, $tpl_var, &$value, $nocache)
  24. {
  25. if ($tpl_var != '') {
  26. $data->tpl_vars[$tpl_var] = new Smarty_Variable(null, $nocache);
  27. $data->tpl_vars[$tpl_var]->value = &$value;
  28. if ($data->_objType == 2 && $data->scope) {
  29. $data->ext->_updateScope->updateScope($data, $tpl_var);
  30. }
  31. }
  32. return $data;
  33. }
  34. }