Managing your Applications在同一个CI中设置多个application文件夹
2015-07-30 13:45
323 查看
By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your
application/ directory. It is possible, however, to have multiple sets of applications that share a single CodeIgniter installation, or even to rename or relocate your application directory.
$application_folder variable:
full server path in the $application_folder variable:
For example, let’s say you want to create two applications, named “foo” and “bar”. You could structure your application directories like this:
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:
Note
Each of your applications will need its own index.php file which calls the desired application. The index.php file can be named anything you want.
By default it is assumed that you only intend to use CodeIgniter to manage one application, which you will build in your
application/ directory. It is possible, however, to have multiple sets of applications that share a single CodeIgniter installation, or even to rename or relocate your application directory.
Renaming the Application Directory¶
If you would like to rename your application directory you may do so as long as you open your main index.php file and set its name using the$application_folder variable:
$application_folder = 'application';
Relocating your Application Directory¶
It is possible to move your application directory to a different location on your server than your web root. To do so open your main index.php and set afull server path in the $application_folder variable:
$application_folder = '/path/to/your/application';
Running Multiple Applications with one CodeIgniter Installation¶
If you would like to share a common CodeIgniter installation to manage several different applications simply put all of the directories located inside your application directory into their own sub-directory.For example, let’s say you want to create two applications, named “foo” and “bar”. You could structure your application directories like this:
applications/foo/ applications/foo/config/ applications/foo/controllers/ applications/foo/libraries/ applications/foo/models/ applications/foo/views/ applications/bar/ applications/bar/config/ applications/bar/controllers/ applications/bar/libraries/ applications/bar/models/ applications/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 = 'applications/foo';
Note
Each of your applications will need its own index.php file which calls the desired application. The index.php file can be named anything you want.
相关文章推荐
- android内存泄露调试经验分享
- Android 处理内存泄露的方法
- android开发之Bundle使用
- android开发之Bundle使用
- android开发之Bundle使用
- android开发之Bundle使用
- php 微信分享朋友圈和发送给朋友
- 【Cocos2d-x】之使用两张图片制作动画
- ios-图片加载方式类别和优缺点
- Android Validation非空格式验证框架的使用
- Object-C 可变字符串(NSMutableString)
- iOS开发常用软件和好用的第三方类库
- android studio ADB无响应
- Android studio gradle
- 百度地图的使用
- Cocos2dx之CCLabelBMFont类
- ios 调用打电话,发短信的功能
- 猫猫学iOS 之微博项目实战(6)导航控制器NavigationController 的滑动回退功能实现
- AndroidManifest.xml file missing!
- Android内存管理之道