QrcodeComponent.class.php (698B)
1 <?php 2 3 namespace template_engine\components\html\component_qrcode; 4 5 use template_engine\components\html\Component; 6 use template_engine\element\CMSElement; 7 use template_engine\element\Value; 8 use template_engine\element\ValueExpression; 9 10 class QrcodeComponent extends Component 11 { 12 13 public $value; 14 15 16 public function createElement() 17 { 18 $qrcode = (new CMSElement('i')) 19 ->addStyleClass('btn') 20 ->addStyleClass('image-icon') 21 ->addStyleClass('image-icon--menu-qrcode') 22 ->addStyleClass('qrcode') 23 ->addStyleClass('info') 24 ->addAttribute('data-qrcode', $this->value) 25 ->addAttribute('title', Value::createExpression(ValueExpression::TYPE_MESSAGE, 'QRCODE_SHOW')); 26 27 return $qrcode; 28 } 29 }