macgyer\yii2materializecss\widgets\grid\ActionColumn::initDefaultButtons PHP Method

initDefaultButtons() protected method

This method uses [[Icon|Icon]] to display iconic buttons.
protected initDefaultButtons ( )
    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(Icon::widget(['name' => 'visibility']), $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(Icon::widget(['name' => 'edit']), $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(Icon::widget(['name' => 'delete']), $url, $options);
            };
        }
    }