Answer the question
In order to leave comments, you need to log in
Laravel 4: how to implement HMVC?
I want to implement an HMVC architecture such that it would be possible to embed HMVC components in a template, and the folder structure would be components/user/models, components/user/views, components/user/controllers. Suggest the best options, examples.
Answer the question
In order to leave comments, you need to log in
I created a modular structure like this: I
created a modules folder, in it all the folders were named with a capital letter, to use psr-4. For example: modules/Api/Controllers. If you do not use autoload, each time adding a new file you will have to run composer dump.
To create namespaces in views and include files like filters.php/routes.php, each module has its own service provider.
Add a namespace for the view:
\View::addNamespace($module['name'],$module['path'].'/views');
Backend\Models\Source::find($id);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question