Ejemplo n.º 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]);
}]]]);
Ejemplo n.º 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]);
Ejemplo n.º 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]);
Ejemplo n.º 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;
}]]]);
Ejemplo n.º 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]);
}]]]);