protected function doInit() { $this->html = new HTMLTag('button', new HTMLTag('span', $this->getLabel(), array('class' => 'ui-button-text')), array('class' => '\\Psc\\button')); $this->html->addClass(array('ui-button', 'ui-widget', 'ui-state-default', 'ui-corner-all')); if (isset($this->leftIcon)) { $this->html->addClass('ui-button-text-icon-primary'); } if (isset($this->rightIcon)) { $this->html->addClass('ui-button-text-icon-secondary'); } if (!isset($this->leftIcon) && !isset($this->rightIcon)) { $this->html->addClass('ui-button-text-only'); } parent::doInit(); if (isset($this->data)) { foreach ($this->data as $key => $value) { jQuery::data($this->html, $key, $value); } } if (isset($this->hint)) { $this->html->after($this->hint); } }