smarty_variable.php (1204B)
1 <?php 2 3 /** 4 * class for the Smarty variable object 5 * This class defines the Smarty variable object 6 * 7 * @package Smarty 8 * @subpackage Template 9 */ 10 class Smarty_Variable 11 { 12 /** 13 * template variable 14 * 15 * @var mixed 16 */ 17 public $value = null; 18 /** 19 * if true any output of this variable will be not cached 20 * 21 * @var boolean 22 */ 23 public $nocache = false; 24 /** 25 * the scope the variable will have (local,parent or root) 26 * 27 * @var int 28 */ 29 public $scope = Smarty::SCOPE_LOCAL; 30 31 /** 32 * create Smarty variable object 33 * 34 * @param mixed $value the value to assign 35 * @param boolean $nocache if true any output of this variable will be not cached 36 * @param int $scope the scope the variable will have (local,parent or root) 37 */ 38 public function __construct($value = null, $nocache = false, $scope = Smarty::SCOPE_LOCAL) 39 { 40 $this->value = $value; 41 $this->nocache = $nocache; 42 $this->scope = $scope; 43 } 44 45 /** 46 * <<magic>> String conversion 47 * 48 * @return string 49 */ 50 public function __toString() 51 { 52 return (string) $this->value; 53 } 54 } 55