blob: e7e45850ed1b3fbd28c8a7284701d15b86625859 [file] [log] [blame]
adminb0dd10f2006-08-25 17:25:49 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html>
3<head>
4
5<title>Code Igniter User Guide</title>
6
7<style type='text/css' media='all'>@import url('../userguide.css');</style>
8<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
9
admin17a890d2006-09-27 20:42:42 +000010<script type="text/javascript" src="../nav/nav.js"></script>
admin2296fc32006-09-27 21:07:02 +000011<script type="text/javascript" src="../nav/prototype.lite.js"></script>
admin17a890d2006-09-27 20:42:42 +000012<script type="text/javascript" src="../nav/moo.fx.js"></script>
adminb0dd10f2006-08-25 17:25:49 +000013<script type="text/javascript">
14window.onload = function() {
admine334c472006-10-21 19:44:22 +000015 myHeight = new fx.Height('nav', {duration: 400});
adminb0dd10f2006-08-25 17:25:49 +000016 myHeight.hide();
17}
18</script>
19
20<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
21<meta http-equiv='expires' content='-1' />
22<meta http-equiv= 'pragma' content='no-cache' />
23<meta name='robots' content='all' />
24<meta name='author' content='Rick Ellis' />
25<meta name='description' content='Code Igniter User Guide' />
26
27</head>
28<body>
29
30<!-- START NAVIGATION -->
31<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
32<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
33<div id="masthead">
34<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
35<tr>
admine0cd6092006-10-20 01:00:31 +000036<td><h1>Code Igniter User Guide Version 1.5.0b3</h1></td>
admin939906b2006-10-11 19:39:48 +000037<td id="breadcrumb_right"><a href="../toc.html">Linear Table of Contents</a></td>
adminb0dd10f2006-08-25 17:25:49 +000038</tr>
39</table>
40</div>
41<!-- END NAVIGATION -->
42
43
44<!-- START BREADCRUMB -->
45<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
46<tr>
47<td id="breadcrumb">
48<a href="http://www.codeigniter.com/">Code Igniter Home</a> &nbsp;&#8250;&nbsp;
49<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
50Running Multiple Applications
51</td>
52<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="www.codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
53</tr>
54</table>
55<!-- END BREADCRUMB -->
56
57<br clear="all" />
58
59
60<!-- START CONTENT -->
61<div id="content">
62
63<h1>Running Multiple Applications with one Code Igniter Installation</h1>
64
65<p>By default it is assumed that you only intend to use Code Igniter to manage one application, which you will build in your
66<dfn>system/application/</dfn> directory. It is possible, however, to have multiple sets of applications that share a single
67Code Igniter installation. To do this you will put all of the directories located inside your <kbd>application</kbd> folder into their
68own sub-folder.</p>
69
70<p>For example, let's say you want to create two applications, "foo" and "bar". You will structure your
71application folder like this:
72
73<code>system/application/<var>foo</var>/<br />
74system/application/<var>foo</var>/config/<br />
75system/application/<var>foo</var>/controllers/<br />
76system/application/<var>foo</var>/errors/<br />
admin17a890d2006-09-27 20:42:42 +000077system/application/<var>foo</var>/libraries/<br />
adminb0dd10f2006-08-25 17:25:49 +000078system/application/<var>foo</var>/models/<br />
adminb0dd10f2006-08-25 17:25:49 +000079system/application/<var>foo</var>/views/<br />
80system/application/<samp>bar</samp>/<br />
81system/application/<samp>bar</samp>/config/<br />
82system/application/<samp>bar</samp>/controllers/<br />
83system/application/<samp>bar</samp>/errors/<br />
admin17a890d2006-09-27 20:42:42 +000084system/application/<samp>bar</samp>/libraries/<br />
adminb0dd10f2006-08-25 17:25:49 +000085system/application/<samp>bar</samp>/models/<br />
adminb0dd10f2006-08-25 17:25:49 +000086system/application/<samp>bar</samp>/views/</code>
87
88
89<p>To select a particular application for use requires that you open your main <kbd>index.php</kbd> file and set the <dfn>$application_folder</dfn>
90variable. For example, to select the "foo" application for use you would do this:</p>
91
92<code>$application_folder = "foo";</code>
93
admin17a890d2006-09-27 20:42:42 +000094<p>Note: Each of your applications will need its own <dfn>index.php</dfn> file (the index.php file can be named anything you want).</p>
adminb0dd10f2006-08-25 17:25:49 +000095
96
97
98
99</div>
100<!-- END CONTENT -->
101
102
103<div id="footer">
104<p>
105Previous Topic:&nbsp;&nbsp;<a href="caching.html">Web Page Caching</a>
106&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
107<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
108<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
109Next Topic:&nbsp;&nbsp;<a href="alternative_php.html">Alternative PHP Syntax</a>
110<p>
111
112<p><a href="http://www.codeigniter.com">Code Igniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 &nbsp;&middot;&nbsp; <a href="http://www.pmachine.com">pMachine, Inc.</a></p>
113</div>
114
115</body>
116</html>