Logo.class.php (1064B)
1 <?php 2 3 namespace template_engine\components; 4 5 use template_engine\components\html\Component; 6 use template_engine\element\CMSElement;use template_engine\element\HtmlElement; 7 use template_engine\element\Value; 8 use template_engine\element\ValueExpression; 9 10 class LogoComponent extends Component 11 { 12 public $name; 13 14 public function createElement() 15 { 16 $logo = new CMSElement('div'); 17 $logo->addStyleClass('line logo'); 18 19 $label = (new HtmlElement('div'))->addStyleClass('label'); 20 21 $image = (new CMSElement('img'))->addAttribute('src','themes/default/images/logo_'.$this->name.'.png')->addAttribute('border','0'); 22 $label->addChild($image); 23 24 $logo->addChild($label); 25 26 $holder = (new HtmlElement('div'))->addStyleClass('input'); 27 $logo->addChild($holder); 28 29 $holder->addChild( (new CMSElement('h2'))->content(Value::createExpression( ValueExpression::TYPE_MESSAGE,'logo_'.$this->name ))); 30 $holder->addChild( (new CMSElement('p') )->content(Value::createExpression( ValueExpression::TYPE_MESSAGE,'logo_'.$this->name.'_text'))); 31 32 return $logo; 33 } 34 35 }