K
K
kott9ra2015-03-16 13:53:03
Yii
kott9ra, 2015-03-16 13:53:03

How to create modules for YII2 correctly?

I am creating an admin panel for the site and the question arises of how to organize everything correctly.
Approximate plan
site.ru/index.php?r=admin //The admin panel itself with the output of all the necessary information
site.ru/index.php?r=admin/posts/[index|edit|delete|view] //The post management page
site.ru/index.php?r=admin/users/[index|edit|delete|view] //User management page
1. I create the admin module
2. I create the postController and userController controllers in the admin\controllers\ folder
3. I create Models and Crud for post and user
In the right direction I think or am I wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2015-03-16
@kott9ra

right.
modules are also made through gii.
One more thing, most likely for controllers in the admin module, you'd better inherit from a controller with admin access only.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question