Answer the question
In order to leave comments, you need to log in
What is the point of modules in Yii2?
Hello. Connoisseurs of yii2, please tell me what is the meaning of modules in the framework? It is clear that the documentation says that this is something isolated that can be used independently in another place.
I'm at a loss for a choice. Where is it better to store modules in the common folder or in the current backend or frontend section if you build a site on modules. I usually build on controllers, where the url looks like controller/action. But I want to start collecting correctly. What is the benefit of using modules?
Answer the question
In order to leave comments, you need to log in
As written in the documentation:
Modules are complete software blocks made up of models, views, controllers, and other supporting components. When modules are installed in an application, the end user gets access to their controllers. For this reason, modules are often viewed as miniature applications. Unlike applications, modules cannot be deployed separately. Modules must be inside applications.
- Backend
- Frontend
- Shop
- Blog
- Backend
- Frontend
- Modules
- Modules/Shop
- Modules/Blog
- Backend/Controller/Shop
- Backend/Controller/Blog
- Frontend/Controller/Shop
- Frontend/Controller/Blog
Например,
so or so . Separation in Models divide everything into module folders:Model/Shop
Model/Blog
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question