Answer the question
In order to leave comments, you need to log in
Yii2, how to make multiple levels in an action?
In general, there is a controller (let's say AdminController.php)
I can easily process paths like example.com/admin/some ( actionSome() )
But what if I want to do something like example.com/admin/users/delete ?id=1 ?
Answer the question
In order to leave comments, you need to log in
You can simply add another UserController and route requests from example.com/admin/users/delete?id=1 to it, and let requests from example.com/admin/some go to AdminController.
See for example how it's done here https://github.com/dektrium/yii2-user/tree/master/...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question