Welcome Guest, Not a member yet? Register   Sign In
Creating two websites on one model
#1

[eluser]Unknown[/eluser]
Hi,

I use codeigniter for a while and know it quite well, but now I have interesting case.

I need to create couple of websites, which will be basically very similar in case of functionality, but not exactly the same. In this case the best option will be to use the same model in each website but different controller and view.

What would be the best way to do that? I know I can load a model straight from controller (with filepath), but I would like to rather control everything from index.
Any ideas how to overwrite the default libraries path?
#2

[eluser]jblack199[/eluser]
Well, I'm sure that you have more experience with codeigniter than I do (been using it for 2-3 days now so i've just scratched the surface but here is what I think.

I agree in your case of needing multiple sites the best option would be different controller and view for each site.

But perhaps for loading the model, you might look into doing something with the $autoload['model'] = array(); functionality of autoload.php. Might be worth looking into anyway. of course in my limited knowledge I only know of the two ways to load the model #1. from the controller, and #2. the autoload -- so maybe something else will read this and have a bit more experience than i do and be able to take both our heads and ideas laid out here and expand upon them.
#3

[eluser]danmontgomery[/eluser]
move the models to the system directory, move system to a shared location.




Theme © iAndrew 2016 - Forum software by © MyBB