Welcome Guest, Not a member yet? Register   Sign In
Modularise MVC Structure
#1

[eluser]Computerzworld[/eluser]
Hello,
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

Code:
http://localhost/myProject/admin/users/manageUsers

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

[eluser]Amit Patel[/eluser]
Hello,
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
#3

[eluser]Haloperidol[/eluser]
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.
#4

[eluser]umefarooq[/eluser]
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

http://localhost/project/admin/user

to add
http://localhost/project/admin/user/add

to edit
http://localhost/project/admin/user/edit/id

its working fine with me

HMVC
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB