Welcome Guest, Not a member yet? Register   Sign In
Multiple application folder in CI
#1

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
Reply
#2

(This post was last modified: 12-28-2015, 06:02 AM by Bhavesh.)

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
Reply
#3

The user guide is missing information about .htaccess and accessing default / second application...
Reply
#4

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)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB