Welcome Guest, Not a member yet? Register   Sign In
Problems with creating subfolders in CodeIgniter 3 HMVC
#1
Photo 

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.
Reply
#2

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
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(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
Reply
#4

(This post was last modified: 06-07-2018, 09:42 AM by InsiteFX.)

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(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
Reply
#6

As I said before Wiredesignz HMVC was not designed to be used like that.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#7

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
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#8

(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.
Reply
#9

HELP ME, please
Reply
#10

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB