我在 _form.php 文件中具有此按钮。
'buttons' => [
'replace' => function($url, $model) {
return Html::a(
'Replace',
[
'/european-countries/replace',
'countryIdReplacement' => '123' // Problem here.
]
);
},
],
我的控制器:
public function actionReplace($countryIdReplacement) {
// My code.
}
URL为:
http://my-site/european-countries/replace?countryIdReplacement=123
我想使用这种可变格式:
http://my-site/european-countries/replace?country-id-replacement=123
但是PHP不允许使用该格式。这是不允许的:
actionReplace($country-id-replacement)