Set.class.php (529B)
1 <?php 2 3 namespace template_engine\components; 4 5 class SetComponent extends Component 6 { 7 public $var; 8 public $value; 9 public $key; 10 11 protected function begin() 12 { 13 if (!empty($this->value)) 14 { 15 if (!empty($this->key)) 16 echo '<?php $'.$this->varname($this->var).'= '.$this->value($this->value).'['.$this->value($this->key).']; ?>'; 17 else 18 echo '<?php $'.$this->varname($this->var).'= '.$this->value($this->value).'; ?>'; 19 } 20 else { 21 // Unset 22 echo '<?php unset($'.$this->varname($this->var).') ?>'; 23 } 24 } 25 } 26 27 28 ?>