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...

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source