Label.class.php (681B)
1 <?php 2 3 namespace template_engine\components; 4 5 use template_engine\components\html\Component; 6 use template_engine\element\CMSElement; 7 use template_engine\element\Value; 8 use template_engine\element\ValueExpression; 9 10 class LabelComponent extends Component 11 { 12 13 /** 14 * @deprecated 15 * @var 16 */ 17 public $for; 18 19 /** 20 * @deprecated 21 * @var 22 */ 23 public $value; 24 25 public $key; 26 27 public $text; 28 29 public function createElement() 30 { 31 $label = new CMSElement('label'); 32 $label->addStyleClass('label'); 33 34 if ( $this->key ) 35 $label->content(Value::createExpression(ValueExpression::TYPE_MESSAGE,$this->key)); 36 37 if ($this->text) 38 $label->content($this->text); 39 40 return $label; 41 } 42 43 }