Answer the question
In order to leave comments, you need to log in
How to ignore case in Yii2 actions?
Faced such a problem:
I wrote this action:
public function actionUpdateContact($id)
{
...
}
site.ru/admin/users/UpdateContact - 404
site.ru/admin/users/updateContact - 404
site.ru/admin/users/Updatecontact - 404
site.ru/admin/users/updatecontact - 404
site.ru/admin/users/UpdateContact - 404
site.ru/admin/users/updateContact - 404
site.ru/admin/users/Updatecontact - 404
site.ru/admin/users/updatecontact - ОК
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
//'enableStrictParsing' => true,
'suffix' => '',
'rules' => [
'' => 'admin/default/index',
// Модуль
'users/<action:\w+>/<id:\d+>' => 'users/default/<action>',
'users/<action:\w+>/<page:\d+>' => 'users/default/<action>',
'users/<action:\w+>/' => 'users/default/<action>',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
]
],
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question