Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
How to Manage Multiple Applications in CodeIgniter
Nov 28, 2017 @ 16:29:11

The TutsPlus.com site has posted a new tutorial showing the CodeIgniter users out there how to manage multiple sites written using the framework. Traditionally CodeIgniter applications needed to be run as separate instances but their method simplifies the setup by needing only one instance for all.

Today, we’re going to explore how you can manage multiple applications in the CodeIgniter web framework using a single codebase. In the course of that, we’ll go ahead and create two different CodeIgniter applications that will share the core CodeIgniter codebase.

Sharing the core codebase across different applications is not something new as it’s already practiced by different frameworks and open-source systems, and CodeIgniter is no different. It easily allows you to manage multiple applications that share the core CodeIgniter library and API files, and at the same time you could use different databases and site-specific configurations.

The article then starts with some of the benefits of using a multisite setup including simpler maintenance and the ability to use different databases for each. It then gets into the process for creating multiple applications using separate directories under an "applications" directory and creating sample "welcome" content under each. Finally, they make some changes to the configuration to use an environment variable to switch out which front controller (index.php) file to direct the request to (as set up in the web server config).

tagged: manage multiple application codeigniter tutorial website

Link: https://code.tutsplus.com/tutorials/manage-multiple-applications-in-codeigniter--cms-29795


Trending Topics: