📜  yii2 gridview action change urls - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:19.131000             🧑  作者: Mango

代码示例1
 [
            ...
            [
                'class' => 'yii\grid\ActionColumn',
                'urlCreator' => function ($action, $model, $key, $index) {
                    return Url::toRoute(['controller/' . $action, 'id' => $model->id]);
                }
            ],
        ],
  ]) ?>