Welcome Guest, Not a member yet? Register   Sign In
CI Application with multiple roots
#1

[eluser]Unknown[/eluser]
How i can divide my CI App into sub roots ex:

news
model
view
controller
politics
model
view
controller
sports
model
view
controller
weather
model
view
controller


with each root has a model, view and controller
#2

[eluser]yacman[/eluser]
You can use CI's Routes to route requests to your controllers however you want.

or you could have:
/controllers/news.php
/controllers/politics.php
/controllers/sports.php
/controllers/weather.php

/models/news_model.php
/models/politics_model.php
/models/sports_model.php
/models/weather_model.php

Or you could have a single controller:

/controllers/home.php
with functions, news, politics, sports, weather.



#3

[eluser]CroNiX[/eluser]
If you want it exactly as you proposed, I would look into "HVMC" by wiredesignz. It also lets you call controllers from other controllers. Haven't used it, but a lot of people do. Do a search for it.
#4

[eluser]PhilTem[/eluser]
As @CroNiX suggests, HMVC would be the thing for you to look into because it allows separation of everything into modules which are basically encapsulated packages containing models, controllers, libraries, helpers, configs, and everything else that is just needed for that one module.




Theme © iAndrew 2016 - Forum software by © MyBB