• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modularise MVC Structure

I want to modularise my CI MVC Structure. I am able to modularise the client side MVC's but not admin side MVC's.

Here is the structure that I want to generate.

controllers -> folder name(=module name) -> client side controllers
controllers -> admin(folder)->another folder(= module name)

But when I am generating folder inside admin folder & if I try to access the controllers inside it, I am unable to access them.

Let me explain this via an example.

If I am having admin folder inside controllers, in this admin folder I have another folder users and in this users folder I have controller named as manageUsers

So, I should be able to access manageUsers controller functions via


But according to MVC structure it will consider users as controller & manageUsers as function but it is not like that. users is folder & manageUsers is controller. So is there any way so that we can tell CI to consider users as folder and manageUsers as controller?

Also I am having one another query. If we are making one folder inside controllers we can able to put another controllers inside. So, how it is going to differentiate between folder & controllers?

Please help me. Thanks in advance.

[eluser]Amit Patel[/eluser]
I want to modularise my CI MVC Structure. I am able to modularise the client side MVC’s but not admin side MVC’s.

I have same problem as above can any one help me

im not sure if this is a good idea, but you could make it work with custom routing for each. see http://ellislab.com/codeigniter/user-gui...uting.html for the guide. But im only guessing, did not test it.

yes you can modularise your admin part also use HMVC library than you directory structure will be like the attached image you can put in controller directory your admin.php,user.php,blog.php,content.php controller and you can call


to add

to edit

its working fine with me


[eluser]Phil Sturgeon[/eluser]
Already answered. Search please :-)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.