How to Handle Multiple Projects in CodeIgniter?

2019-02-28 23:45发布

问题:

When coding in Visual Studio, I can have multiple website projects, and I'm able to switch between them by opening each website project on the local drive. I'm confused at how CodeIgniter handles this operation in Visual Studio. It seems the programming environment is the actual install location. How do I start to code a new website while preserving the code of the previous one? Is there a script to package a project, export the package, and then import it later?

回答1:

Codeigniter's documentation walks you through managing multiple applications with one installation

As noted in the link above, after structuring your application folder,

Each of your applications will need its own index.php file which calls the desired application.



回答2:

I would like to further explain that after you have duplicated the index.php file you will need to go into your base directories .htaccess file and add a few new rewrite statements to the file.

I have previously taken my application/controllers folder and added subdirectories for each application. The controller routing would have to reflect these changes.