Multiple application folder in CI |
Hi team,
I have a query regarding architecture level for CI. Till date , we are using single application folder to manage front side and admin panel. But I want to update this architecture and want to use multiple application folder. I just want to know pros and cons for multiple application folder. Looking forward to hear some expert views ...... Thanks
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 folder into their own sub-folder.
For example, let's say you want to create two applications, "foo" and "bar". You could structure your application folders like this: applications/foo/ applications/foo/config/ applications/foo/controllers/ applications/foo/errors/ applications/foo/libraries/ applications/foo/models/ applications/foo/views/ applications/bar/ applications/bar/config/ applications/bar/controllers/ applications/bar/errors/ applications/bar/libraries/ applications/bar/models/ applications/bar/views/ Ref: https://ellislab.com/codeigniter/user-gu..._apps.html
The user guide is missing information about .htaccess and accessing default / second application...
I am doing it like this:
application/* for controllers front application/admin/* for controllers for admin panel I would also extend the controllers from a "core" controller. eg. Dashboard extends Admin_controller. Admin_controller here would extend from MY_Controller. This way I can easily build things like access control for different areas of the applications. So in the application/core folder, I have something like this: MY_Controller.php Front_Controller.php (extends MY_Controller) Admin_Controller.php (extends MY_Controller) |
Welcome Guest, Not a member yet? Register Sign In |