Exemple #1
0
<?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]);
}]]]);
Exemple #2
0
<?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]);
Exemple #3
0
<?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]);
Exemple #4
0
<?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;
}]]]);
Exemple #5
0
<?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]);
}]]]);