Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9122989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:13:57+00:00 2026-06-17T06:13:57+00:00

Im using CI-HMVC stock. Id like to have a module structure like this: application

  • 0

Im using CI-HMVC stock.
Id like to have a module structure like this:

application
    modules
        userabc
            moduleA
                controllers
                models
                views
            moduleB
                ...
        userDEF
            moduleC
                ...

Is this an incorrect way of module organization? Is there another common way of doing something like this?

Im wanting to seperate the users module folders and use them in a URL like this:
userABC.domain.com/module/controller/method
userBCD.domain.com/module/controller/method

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:13:58+00:00Added an answer on June 17, 2026 at 6:13 am

    You can use that structure if you want, but keep in mind the following:

    You must define each user’s directory as a module location:

    // application/config/config.php
    $config['modules_locations'] = array(
        // Absolute path              // Relative from default application dir
        APPPATH.'modules/userABC/' => '../modules/userABC/',
        APPPATH.'modules/userDEF/' => '../modules/userDEF/',
        APPPATH.'modules/userGHI/' => '../modules/userGHI/',
        // etc.
    );
    

    You might be able to do this dynamically, but remember that config.php is loaded pretty early so you may need a pre_system hook.

    The other thing, which is important if you want all users’ modules accessible regardless of which subdomain is active: Order matters!

    If userA has a module called “blog” and so does userB, only userA’s will ever get loaded (assuming you define userA’s module path first). If you’re certain no two modules will share the same name, this won’t matter as much, but you may suffer a performance hit as the loader will go through the whole stack of module locations until it finds the requested one.

    It sounds like you should define a single module_location depending on what user’s site is loaded (the subdomain). Something like:

    // Get this value dynamically (not sure how you need to do it)
    $current_user = 'userABC';
    
    $config['modules_locations'] = array(
        APPPATH.'modules/'.$current_user.'/' => '../modules/'.$current_user.'/'
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Code Igniter, The HMVC library , and Smarty with this library
I am using GWT 2.0.3 with ext in my application.This project is no longer
Using RestKit 0.10.1, I have objects served similar to this json format: {objects: [
Using range() in Underscore I can make something like this: _.range(10); >> [0, 1,
I'm using HMVC and calling modules in a view. In some cases however, the
I am using Codeigniter 1.7.2 and HMVC (https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home). I have these files and they
I am using Code igniter with HMVC, We are creating drop-in modules. One thing
I am working with Codeignitor 2.x and I was originally using controllers as modules
the PHP framework I am using (Kohana) recently implemented the HMVC architecture. I have
I am using the HMVC pattern in CodeIgniter. I have a controller that loads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.