kartik\grid\GridView::renderToolbar PHP 메소드

renderToolbar() 보호된 메소드

Generates the toolbar.
protected renderToolbar ( ) : string
리턴 string
    protected function renderToolbar()
    {
        if (empty($this->toolbar) || !is_string($this->toolbar) && !is_array($this->toolbar)) {
            return '';
        }
        if (is_string($this->toolbar)) {
            return $this->toolbar;
        }
        $toolbar = '';
        foreach ($this->toolbar as $item) {
            if (is_array($item)) {
                $content = ArrayHelper::getValue($item, 'content', '');
                $options = ArrayHelper::getValue($item, 'options', []);
                static::initCss($options, 'btn-group');
                $toolbar .= Html::tag('div', $content, $options);
            } else {
                $toolbar .= "\n{$item}";
            }
        }
        return $toolbar;
    }