CodeIgniter Forums
How to install more than 2 applications in one /system - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to install more than 2 applications in one /system (/showthread.php?tid=48855)



How to install more than 2 applications in one /system - El Forum - 01-31-2012

[eluser]Shiju S S[/eluser]
I have : four applications:
How can i setup the index.php and config.php files

quickbharath/applications/

admin
exeuser
user
front

Please help me.


How to install more than 2 applications in one /system - El Forum - 01-31-2012

[eluser]Aken[/eluser]
http://ellislab.com/codeigniter/user-guide/general/managing_apps.html


How to install more than 2 applications in one /system - El Forum - 01-31-2012

[eluser]porquero[/eluser]
I found two ways to work with different applications in CI.

A)
You can use the configuration recomended in the tutorial and get like some this:
http://ellislab.com/codeigniter/user-guide/general/managing_apps.html

/system
-/apps
--/app1
--/app2
--/appN
/app1.php
/app2.php
/appN.php

Advantages

* Clearly apps separated
* Easy to move/copy apps


Disadvantages

* Duplicate code
* One config for each app
* Is not friendly url

B)
Or, if you are working in the same configuration, maybe you wan't modify each configuration file or create one loader for each app. So you can use controllers directory to separate your apps:

/system
/application
-/controllers
--/app1
--/app2
--/appN
/views
-/app1
--/controller1..N.php
---/view1..N.php
/Models
-/app1
--/controller1..N
---/model1..N.php
-/app2
-/appN
/index.php

Advantages

* Only one config file
* Fast navigation in file system
* Use Don't repeat yourself

Disadvantages

* Possibles collitions for personalized CI elements (MY_helper, MY_library)
* Path to call views long ($this->load->view('app1/controller1/view1')Wink

___
I prefeer B solution Confusedmirk:
I hope that help you.