Answer the question
In order to leave comments, you need to log in
How to pass a third-party variable to urlCreator()?
When generating links for ActionColumn GridView::widget, you need to pass a get parameter that is stored in a separate variable, how to do this?
Answer the question
In order to leave comments, you need to log in
Good evening.
Override buttons in ActionColumn .
Approximately like this:
[
'class' => 'yii\grid\ActionColumn',
'buttons' => [
'view' => function($url, $model, $key){
return Html::a('view',$url . '/car/' . $model->username ); // в общем подставьте свои параметры.
},
'update' => function($url, $model, $key){
// your code
},
'delete' => function($url, $model, $key){
// your code
}
]
]
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update} {delete} {customButton}',
'buttons' => [
'view' => function($url, $model, $key){
return Html::a('view',$url . '/car/' . $model->username ); // в общем подставьте свои параметры.
},
'update' => function($url, $model, $key){
// your code
},
'delete' => function($url, $model, $key){
// your code
},
'customButton' => function($url, $model, $key){
return Html::a('CustomButton', ['/site/index']); // параметры, конечно же, подставьте свои.
}
]
]
'view' => function($url, $model, $key) use ($your_param){
return Html::a('view',$url . '/car/' . $your_param ); // в общем подставьте свои параметры.
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question