A
A
alex stephen2015-04-10 11:24:28
Yii
alex stephen, 2015-04-10 11:24:28

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

2 answer(s)
V
vyachin, 2015-04-10
@berezuev

read here www.yiiframework.com/doc-2.0/guide-structure-modul...

M
matperez, 2015-04-10
@matperez

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 question

Ask a Question

731 491 924 answers to any question