Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeIgniter: Multiple Applications, how to share resources?

Tags:

codeigniter

I'm building a multi-app site on CodeIgniter. I foresee some of the libraries, helpers, etc. being needed across applications. How do I share such resources between applications? It seems like I can put libraries and helpers under the system folder, but what if I need to share models, controllers, views, too?

like image 942
StackOverflowNewbie Avatar asked Jan 10 '11 21:01

StackOverflowNewbie


People also ask

How to manage multiple applications in CodeIgniter?

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 directory into their own sub-directory. Each of your applications will need its own index. php file which calls the desired application. The index.

Is CodeIgniter good for large applications?

CodeIgniter is suitable for small and medium projects. but for larger projects, CodeIgniter is not a perfect solution. because of lack of functions available, it is hard to develop or customize requirements.

What is Apppath in CodeIgniter?

APPPATH is a codeigniter constant. It contains value of the full path to your application folder.

What is root in CodeIgniter?

Root in codeigniter specifically means that the position where you can append your controller to your url. For example, if the root is localhost/ci_installation/index. php/ , then to access the mycont controller you should go to localhost/ci_installation/index.


1 Answers

This article helped me when developing multiple applications in the same install, I then used .htaccess for different applications and different domain names.

Codeigniter Wiki - Multiple Applications

You would probably have to experiment with the way the folders are set up and the way calls are made in order to access shared models controllers and views.

This post multiple sites, 1 codebase, using symlinks (with smarty) might help but might not be the way you want to do it.

like image 85
Kieran Andrews Avatar answered Sep 22 '22 14:09

Kieran Andrews