I have the following controller “AjaxController” with the following action “actionRoleUsers”. I don’t understand why when I set this rule
[
'pattern'=>'ajax/<action:\w+>/<id>',
'route' => '<controller>/<action>',
'defaults' => ['id' => ""],
],
and try to consume the url ajax/role-users/1 a 404 error is thrown as opposed to setting this rule the action is carried out successfully. I am trying not to set the specific rule for every action which will be set in the mentioned controller
[
'pattern'=>'<controller:(ajax)>/role-users/<id>',
'route' => 'ajax/role-users',
'defaults' => ['id' => ""],
],