<?php use common\widgets\admin\Grid; /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var app\modules\news\models\News $searchModel */ echo Grid::widget(['dataProvider' => $dataProvider, 'model' => $searchModel, 'userColumns' => [['class' => \yii\grid\DataColumn::className(), 'header' => Yii::t('news/app', 'Link'), 'value' => function ($model, $index, $widget) { return Yii::$app->urlManager->createUrl(['/news/news/detail', 'section' => $model->sections[0]->code, 'code' => $model->code]); }]]]);
<?php use common\widgets\admin\Grid; /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var app\modules\main\models\Review $searchModel */ echo Grid::widget(['dataProvider' => $dataProvider, 'model' => $searchModel]);
<?php use common\widgets\admin\Grid; /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var app\modules\main\models\Menu $searchModel */ echo Grid::widget(['dataProvider' => $dataProvider, 'model' => $searchModel, 'tree' => true]);
<?php use common\widgets\admin\Grid; /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var app\modules\main\models\Comments $searchModel */ echo Grid::widget(['dataProvider' => $dataProvider, 'model' => $searchModel, 'tree' => true, 'userColumns' => [['class' => \yii\grid\DataColumn::className(), 'header' => Yii::t('main/app', 'Comments'), 'value' => function ($model, $index, $widget) { return $model->childrenCount; }]]]);
<?php use common\widgets\admin\Grid; /** * @var yii\web\View $this * @var yii\data\ActiveDataProvider $dataProvider * @var app\modules\main\models\Pages $searchModel */ ?> <?php echo Grid::widget(['dataProvider' => $dataProvider, 'model' => $searchModel, 'tree' => true, 'userColumns' => [['class' => \yii\grid\DataColumn::className(), 'header' => Yii::t('main/app', 'Link'), 'value' => function ($model, $index, $widget) { return Yii::$app->urlManager->createUrl(['/main/pages/index', 'model' => $model]); }]]]);