Welcome Guest, Not a member yet? Register   Sign In
HMVC Modularity - subdirectories in modules
#1

(This post was last modified: 10-21-2015, 02:14 PM by Lykos22.)

I'd like some help please. I'm using HMVC modularity from wiredesignz and my folder structure looks like this

Code:
- application
---- modules
------- test
---------- controllers
---------------- Admin.php
---------------- Some_front_controller.php
---------- models
---------------- Some_model.php
---------- views
---------------- some_view.php

I have also set up the routes for "admin" pages like this:
PHP Code:
$route['admin/([a-zA-Z_-]+)/(:any)'] = '$1/admin/$2';
$route['admin/([a-zA-Z_-]+)/(:any)/(:num)'] = '$1/admin/$2/$3';
$route['admin/login'] = 'admin/login';
$route['admin/logout'] = 'admin/logout';
$route['admin/([a-zA-Z_-]+)'] = '$1/admin/index';
$route['admin'] = 'admin'

so basically the uri_string looks something like this
Code:
admin/test/method/param

Inside the Admin.php I have some methods I'd like to separate them from this, BUT NOT having them in a different module folder. Is it possible to create a sub folder and place them inside there? something like this

Code:
- application
---- modules
------- test
---------- controllers
---------------- sub_directory
------------------------- Admin.php (??? name of the file ???)
---------------- Admin.php

so the uri would be something like this
Code:
admin/test/sub_directory/method/param

Has anyone tried something similar before? If so, do I also have to name the file Admin.php again, or this will cause conflicts ? How do I have to set the routes in this case ?
Reply
#2

You can have a libraries folder so put them in a class library.
What did you Try? What did you Get? What did you Expect?

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

(This post was last modified: 10-21-2015, 02:36 PM by Lykos22.)

(10-21-2015, 02:30 PM)InsiteFX Wrote: You can have a libraries folder so put them in a class library.

No its not a library this. There are some controller methods that I'd like to keep the separate from Admin.php, but without putting them in another module.

Think of something similar you could do in a default CI setup where you can create some sub directories inside controllers and place some controllers there, if that make scence.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB