openrat-cms

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

PartComponent.class.php (538B)


      1 <?php
      2 
      3 namespace template_engine\components\html\component_part;
      4 
      5 use template_engine\components\html\Component;
      6 use template_engine\element\CMSElement;
      7 use template_engine\element\HtmlElement;
      8 
      9 class PartComponent extends Component
     10 {
     11 	public $class = '';
     12 	public $id;
     13 	public $tag = 'div';
     14 	
     15 	public function createElement()
     16 	{
     17 		$element = (new CMSElement($this->tag));
     18 
     19 		$element->addStyleClass( Component::splitByComma( $this->class ) );
     20 		
     21 		if	( $this->id )
     22 			$element->addAttribute('id',$this->id);
     23 			
     24 		return $element;
     25 	}
     26 	
     27 }