开发者

multiple applications with codeigniter from same framework directory?

开发者 https://www.devze.com 2022-12-18 17:45 出处:网络
could i use one codeigniter framework directory to create multiple applications? cause it seems that i have to have separate codeigniter folder instances for different applications. i want to be able

could i use one codeigniter framework directory to create multiple applications?

cause it seems that i have to have separate codeigniter folder instances for different applications. i want to be able to adjust some code in one place (classes that are universal) and every application i created with 开发者_开发问答codeigniter will be affected.

with yii you could do this.


you can do this folder structure:

system
website-1 (your application)
----application
----index.php
website-2  (your application)
----application
----index.php
website-3  (your application)
----application
----index.php

move the 'codeigniter application folder' from the system and put it in one of you application folders.

copy the index.php file and paste inside your application folder.

In the index.php file:

YOu should have the following:

$system_folder = "../system";
$application_folder = "application";


Both Colin and Thorpe are correct.

Out of the box, sharing is not perfect. If you want to share libraries you have to put them in the system/libraries folder which makes upgrading that little bit more difficult and models cannot be shared at all.

To created a "shared" directory for libraries and models then you can use this MY_Loader.


could i use one codeigniter framework directory to create multiple applications?

Yes, you can create multiple applications with one CodeIgniter instance

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号