library/smarty/libs/sysplugins/smarty_variable.php
changeset 46 f11c31f7fa3e
parent 45 a56e7f9a0463
child 47 03388ec805b4
equal deleted inserted replaced
45:a56e7f9a0463 46:f11c31f7fa3e
     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      * template variable
       
    13      *
       
    14      * @var mixed
       
    15      */
       
    16     public $value = null;
       
    17     /**
       
    18      * if true any output of this variable will be not cached
       
    19      *
       
    20      * @var boolean
       
    21      */
       
    22     public $nocache = false;
       
    23     /**
       
    24      * the scope the variable will have  (local,parent or root)
       
    25      *
       
    26      * @var int
       
    27      */
       
    28     public $scope = Smarty::SCOPE_LOCAL;
       
    29 
       
    30     /**
       
    31      * create Smarty variable object
       
    32      *
       
    33      * @param mixed $value the value to assign
       
    34      * @param boolean $nocache if true any output of this variable will be not cached
       
    35      * @param int $scope the scope the variable will have  (local,parent or root)
       
    36      */
       
    37     public function __construct($value = null, $nocache = false, $scope = Smarty::SCOPE_LOCAL) {
       
    38         $this->value = $value;
       
    39         $this->nocache = $nocache;
       
    40         $this->scope = $scope;
       
    41     }
       
    42 
       
    43     /**
       
    44      * <<magic>> String conversion
       
    45      *
       
    46      * @return string
       
    47      */
       
    48     public function __toString() {
       
    49         return (string)$this->value;
       
    50     }
       
    51 }
       
    52