Label.class.php (659B)
1 <?php 2 3 namespace template_engine\components; 4 5 class LabelComponent extends Component 6 { 7 8 public $for; 9 10 public $value; 11 12 public $key; 13 14 public $text; 15 16 public function begin() 17 { 18 echo '<label'; 19 20 if (! empty($this->for)) 21 { 22 23 echo ' for="<?php echo REQUEST_ID ?>_' . $this->htmlvalue($this->for); 24 if (isset($this->value)) 25 echo '_' . $this->htmlvalue($this->value); 26 echo '"'; 27 } 28 29 echo ' class="label"'; 30 echo '>'; 31 32 if ( !empty($this->key)) 33 echo '<?php echo lang(' . $this->value($this->key) . ') ?>'; 34 35 if (isset($this->text)) 36 echo $this->htmlvalue($this->text); 37 } 38 39 public function end() 40 { 41 echo '</label>'; 42 } 43 } 44 45 ?>