title = $model->name; $this->params['breadcrumbs'][] = ['label' => '前端商品分类', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; \yii\web\YiiAsset::register($this); $filter_attr_arr = explode(',', $model->filter_attr); $attr_str = ''; foreach ($filter_attr_arr as $filter_attr_id) { $attr = Attribute::findOne($filter_attr_id); if ($attr) { $attr_str = $attr_str . ',' . $attr->name; } } $attr_str = substr($attr_str, 1); ?>

'btn btn-success']) ?>

$model, 'attributes' => [ 'id', 'name', 'keywords', 'desc', 'sort_order', ['attribute' => 'icon', 'width'=>'10%', 'format' => 'raw', 'value' => function ($model) { return $model->iconFile ? \yii\bootstrap4\Html::img(['/'.$model->iconFile->path], ['style' => 'width:80px']) : '未设置'; } ], ['attribute' => 'filter_attr', 'value' => $attr_str ], ['attribute' => 'is_show', 'width' => '5%', 'value' => function ($model) { return $model->is_show == ShopCategory::IS_SHOW_HIDE ? '隐藏' : '显示'; }, ], 'created_at:datetime', 'updated_at:datetime', ], ]) ?>