Answers for "can we put multiple controllers in one controller folder in hmvc"

1

can we put multiple controllers in one controller folder in hmvc

HMVC stands for Hierarchical model–view–controller, which means in Wiredesignz HMVC there is an additional variation called modules added to the classical MVC pattern used by Codeigniter.

in your case if you have users and products, its probably the best to create 2 modules (users and products).

So your folder structure would look like

modules
    - users
        - controllers
            User.php
        - models
        - views

    - products
        - controllers
            Product.php
        - models
        - views
in Wiredesignz HMVC Integration there is a class MX_Controller, so every module controller has to extend from it.

an example

class Product extends MX_Controller{}
And if you want to call another modules controller within your specific controller you simply have to call

$return = modules::run('products/product/your_function');

Though in most cases it's probably a cleaner solution to just call the models from the other modules instead of executing a controllers function...
Posted by: Guest on May-27-2021

Code answers related to "can we put multiple controllers in one controller folder in hmvc"

Browse Popular Code Answers by Language