Code Igniter User Guide Version 1.4.1


Running Multiple Applications with one Code Igniter Installation

By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your system/application/ directory. It is possible, however, to have multiple sets of applications that share a single Code Igniter installation. To do this you will put all of the directories located inside your application folder into their own sub-folder.

For example, let's say you want to create two applications, "foo" and "bar". You will structure your application folder like this: system/application/foo/
system/application/foo/config/
system/application/foo/controllers/
system/application/foo/errors/
system/application/foo/models/
system/application/foo/scripts/
system/application/foo/views/
system/application/bar/
system/application/bar/config/
system/application/bar/controllers/
system/application/bar/errors/
system/application/bar/models/
system/application/bar/scripts/
system/application/bar/views/

To select a particular application for use requires that you open your main index.php file and set the $application_folder variable. For example, to select the "foo" application for use you would do this:

$application_folder = "foo";