Answer the question
In order to leave comments, you need to log in
How in YII2, instead of actionUpdate, do actionEdit and change links in VIew?
There is a User controller that has actionEdit instead of actionUpdate.
Need In the index.php view of this controller, change the edit links from user/update/1 , user/update/2.... to user/edit/1, user/edit/2....
How to do this?
UPD:
I did it like this)
['class' => 'yii\grid\ActionColumn', 'buttons'=>[
'update'=>function ($url, $model) {
$customurl=Yii::$app->getUrlManager()->createUrl(['user/edit','id'=>$model['id']]); //$model->id для AR
return Html::a( '<span class="glyphicon glyphicon-pencil"></span>', $customurl,
['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']);
}
]]
Answer the question
In order to leave comments, you need to log in
https://github.com/yiisoft/yii2/blob/master/framew... lines
57 and 83
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question