public function run() { if (count($this->roles) == 0 || Yii::$app->user->identity->in($this->roles)) { echo Html::endTag('div') . Html::endTag('div'); // .col-* } }
public function run() { $content = empty($this->content) ? '' : $this->content; $tail = Html::endTag('div'); // .box-body if (!empty($this->footer)) { $tail .= Html::tag('div', $this->footer, ['class' => 'box-footer']); } $tail .= Html::endTag('div'); // .box ends return $content . $tail; }
/** * Migrate glyphicon to fant awesome * * Initializes the default button rendering callbacks. */ protected function initDefaultButtons() { if (!isset($this->buttons['view'])) { $this->buttons['view'] = function ($url, $model, $key) { $options = array_merge(['title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0'], $this->buttonOptions); return Html::a(Html::icon('eye'), $url, $options); }; } if (!isset($this->buttons['update'])) { $this->buttons['update'] = function ($url, $model, $key) { $options = array_merge(['title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0'], $this->buttonOptions); return Html::a(Html::icon('pencil'), $url, $options); }; } if (!isset($this->buttons['delete'])) { $this->buttons['delete'] = function ($url, $model, $key) { $options = array_merge(['title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0'], $this->buttonOptions); return Html::a(Html::icon('trash'), $url, $options); }; } }
/** * Fix the problem that the toggle button * is missing in AdminLTE. * * @return string the rendering toggle button. */ protected function renderToggleButton() { $bar = Html::icon('bars'); $screenReader = "<span class=\"sr-only\">{$this->screenReaderToggleText}</span>"; return Html::button("{$screenReader}\n{$bar}", ['class' => 'navbar-toggle', 'data-toggle' => 'collapse', 'data-target' => "#{$this->containerOptions['id']}"]); }