NativeHtmlComponent.class.php (436B)
1 <?php 2 3 namespace template_engine\components\html; 4 5 use template_engine\components\html\HtmlComponent; 6 use template_engine\element\HtmlElement; 7 8 class NativeHtmlComponent extends HtmlComponent 9 { 10 public $attributes; 11 public $tag; 12 13 public function createElement() 14 { 15 $html = new HtmlElement( $this->tag ); 16 17 foreach ($this->attributes as $attribute) 18 $html->addAttribute( $attribute->name,$attribute->value ); 19 20 return $html; 21 } 22 }