CodeIgniter Forums
Problems with creating subfolders in CodeIgniter 3 HMVC - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: Problems with creating subfolders in CodeIgniter 3 HMVC (/showthread.php?tid=70838)



Problems with creating subfolders in CodeIgniter 3 HMVC - surma - 06-06-2018

I have a project that contains several subfolders, such as:

  1. client (folder name)
     auth (sub folder )
                        login(sub sub folder)
                           model+view+controller

                        signup(sub sub folder )
                           model+view+controller
  1. admin(folder name)
    • signin(sub folder) 
          model+view+controller
I set up my routes like this:
Code:
$route['default_controller'] = "admin/signin/signin";
$route['admin/signin'] = "admin/signin/signin/index";
$route['admin/(:any)'] = "admin/signin/signin/$1";
$route['client/auth'] = "auth/signin/signin";
$route['client/auth'] = "client/auth/signin/signin";
$route['client/auth/(.*)'] = "client/auth/signin/signin/$1";
These routes are not working, which shows CodeIgniter 404 error page.  I have also attached an image of my file structure.           please help to solve this issue.


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - InsiteFX - 06-06-2018

HMVC was not created to use sub-folder, I think someone on here modified the source code to
make it work. You would new to search the forums at the bottom HMVC


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - surma - 06-07-2018

(06-06-2018, 09:08 AM)InsiteFX Wrote: HMVC was not created to use sub-folder, I think someone on here modified the source code to
make it work. You would new to search the forums at the bottom HMVC

Then how can I solve this issue with codeigniter


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - InsiteFX - 06-07-2018

From what I remember is that the way it was designed was that you had a structure like this:

./application
-- modules
-- -- module name
-- -- -- config
-- -- -- controllers (controller name should match module name for default controller - controllers can have sub-folders)
-- -- -- routes
-- -- -- views (views can also have sub folders)

Did you add this to your config.php file?

PHP Code:
$config['modules_locations'] = array(
 
   APPPATH.'modules/' => '../modules/',
); 

That tells it where to find the modules.


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - surma - 06-08-2018

(06-07-2018, 09:41 AM)InsiteFX Wrote: From what I remember is that the way it was designed was that you had a structure like this:

./application
-- modules
-- -- module name
-- -- -- config
-- -- -- controllers (controller name should match module name for default controller - controllers can have sub-folders)
-- -- -- routes
-- -- -- views (views can also have sub folders)

Did you add this to your config.php file?

PHP Code:
$config['modules_locations'] = array(
 
   APPPATH.'modules/' => '../modules/',
); 

That tells it where to find the modules.

Yeas, I have this bit of code in my config files..but its not working


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - InsiteFX - 06-08-2018

As I said before Wiredesignz HMVC was not designed to be used like that.


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - InsiteFX - 06-08-2018

If you want to learn about Wiredesignz HMVC then create an account on this site and and also read the forums.

David's - The Insider Club


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - surma - 06-11-2018

(06-08-2018, 03:30 AM)InsiteFX Wrote: As I said before Wiredesignz HMVC was not designed to be used like that.
If you dont mind can you tell me, how can I make my module stucture to work....I searched on this forum and find similar post same as mine But could not find any solution.


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - surma - 07-05-2018

HELP ME, please


RE: Problems with creating subfolders in CodeIgniter 3 HMVC - InsiteFX - 07-05-2018

Like I said before it is the way that it was designed, it has to have the ModuleName first.

You can try creating your own routes file in your modules.