openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

RowComponent.class.php (536B)


      1 <?php
      2 
      3 namespace template_engine\components\html\component_row;
      4 
      5 use template_engine\components\html\Component;
      6 use template_engine\element\CMSElement;
      7 
      8 class RowComponent extends Component
      9 {
     10 
     11 	public $class = '';
     12 
     13 	public $header = false;
     14 
     15 	public $id = '';
     16 
     17 	public function createElement()
     18 	{
     19 		$row = new CMSElement('tr' );
     20 		
     21 		if ($this->class)
     22 			$row->addStyleClass($this->class);
     23 		
     24 		if ($this->header)
     25 			$row->addStyleClass('table-header');
     26 
     27 		if ($this->id)
     28 			$row->addAttribute('data-id',$this->id);
     29 
     30 		return $row;
     31 	}
     32 }