File modules/template_engine/components/html/component_label/LabelComponent.class.php

Last commit: Wed Oct 14 22:36:29 2020 +0200	Jan Dankert	Refactoring: Fixed the namespace in component classes, now the are able to be load by the standard autoloader.
1 <?php 2 3 namespace template_engine\components\html\component_label; 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 }
Download modules/template_engine/components/html/component_label/LabelComponent.class.php
History Wed, 14 Oct 2020 22:36:29 +0200 Jan Dankert Refactoring: Fixed the namespace in component classes, now the are able to be load by the standard autoloader. Wed, 14 Oct 2020 22:20:22 +0200 Jan Dankert Refactoring: Renamed component folders, because 'if' is no valid namespace fragment.