CodeIgniter Forums
Multiple Sites with same controllers and classes but different views. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Multiple Sites with same controllers and classes but different views. (/showthread.php?tid=35758)



Multiple Sites with same controllers and classes but different views. - El Forum - 11-10-2010

[eluser]Unknown[/eluser]
Hi,

Newbie alert :cheese: have just come across codeigniter the other day and from reading alot of the documentation and watching the videos I like what I see and am keen to get started on redeveloping our sites using Codeigniter.

I wanted to ask first if any one can recomend the best way to go about structuring the sites so I can re-use the same controllers and code for each site without duplicating the code. So each site would have the same named views but the html in the views would differ.
The reason for this would be if I had to make a change to a controller or class I would only have to copy it once and not X times for each site. I guess I could do it with symbolic links under linux but was wondering if there was a better way ?

Any help or advice much appreciated.


Multiple Sites with same controllers and classes but different views. - El Forum - 11-10-2010

[eluser]smilie[/eluser]
Look into CI native templating and also search CI Wiki for the alternative template engines.

Cheers,
Smilie


Multiple Sites with same controllers and classes but different views. - El Forum - 11-10-2010

[eluser]natefons[/eluser]
if the sites are different...why not create new CI folder?
and just copy the application folder into the new CI folder...that way you will have ALL your controllers/models/helpers
and all you need to do is change the views