public function init() { parent::init(); if (!in_array($this->type, [self::TYPE_DEFAULT, self::TYPE_PRIMARY, self::TYPE_SUCCESS, self::TYPE_INFO, self::TYPE_WARNING, self::TYPE_DANGER])) { throw new InvalidConfigException('Invalid panel type: ' . VarDumper::dumpAsString($this->type)); } if (!isset($this->options['id'])) { $this->options['id'] = $this->getId(); } Html::addCssClass($this->options, 'panel'); Html::addCssClass($this->options, 'panel-' . $this->type); echo Html::beginTag('div', $this->options); if (isset($this->header)) { echo Html::tag('div', $this->header, $this->headerOptions); } if ($this->hasBody) { echo Html::beginTag('div', $this->bodyOptions); } }
public function init() { parent::init(); Html::addCssClass($this->options, 'btn'); }