fix content-admin

parent 017486fd
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\helpers\Url; use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\grid\GridView; use yii\grid\GridView;
use common\modules\content\models\CoCategory;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $searchModel common\modules\content\models\SearchCoContent */ /* @var $searchModel common\modules\content\models\SearchCoContent */
...@@ -18,7 +20,7 @@ use yii\grid\GridView; ...@@ -18,7 +20,7 @@ use yii\grid\GridView;
<?= \common\components\zii\AdminGrid::widget([ <?= \common\components\zii\AdminGrid::widget([
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
//'filterModel' => $searchModel, 'filterModel' => $searchModel,
'columns' => [ 'columns' => [
// 'name', // 'name',
//'url:url', //'url:url',
...@@ -31,6 +33,7 @@ use yii\grid\GridView; ...@@ -31,6 +33,7 @@ use yii\grid\GridView;
], ],
[ [
'attribute' => 'category_id', 'attribute' => 'category_id',
'filter' => ArrayHelper::map(CoCategory::find()->all(), 'id', 'name'),
'format' => 'text', 'format' => 'text',
'value' => function($data) { 'value' => function($data) {
if(!empty($data->category)) if(!empty($data->category))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment