Beispiel #1
0
<?php

use yii\data\ActiveDataProvider;
use yii\helpers\Url;
/**
 * @var ActiveDataProvider $dataProvider
 * @var int                $categoryId
 */
?>

<?php 
\yii\grid\GridView::begin(['dataProvider' => $dataProvider, 'columns' => ['attribute_name', ['class' => \yii\easyii\components\grid\ActionColumn::class, 'template' => '{update}', 'urlCreator' => function ($action, $model, $key, $index) {
    $params = is_array($key) ? $key : ['id' => (string) $key];
    $params[0] = 'attribute';
    return Url::toRoute($params);
}]]]);
?>

<?php 
\yii\grid\GridView::end();