K
K
kranopodem2015-03-25 19:28:29
Yii
kranopodem, 2015-03-25 19:28:29

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....
f34dce65d7ed26d2e04d41d3cee8d3.png
00f86f96bbf92757d1d256df47d4b6.png
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

1 answer(s)
M
Maxim Grechushnikov, 2015-03-25
@kranopodem

https://github.com/yiisoft/yii2/blob/master/framew... lines
57 and 83

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question