Extending a "standard" application with customer specific files |
[eluser]Jocke[/eluser]
Hello, I have an application that I want to create a number of customer specific version of. In my "corewebsite" I have the standard application and I'm wondering how to proceed if I would like to create a new version of this one with some new or changed files. Basicly I would want the "corewebsite" to act as a fallback for the customer applications to save me the trouble of updating all the customer sites when I do a change to the "corewebsite". Quote:/www Anyone that have done something like this or if it's even possible without rewriting the whole framework? Thanks!
[eluser]jjDeveloper[/eluser]
Try using GIT to implement version controll in your template application then you you can create branches for each instance all in one directory structure. Then a GIT pull will update your application instances. Just a thought
[eluser]Jocke[/eluser]
[quote author="jjDeveloper" date="1327511184"]Try using GIT to implement version controll in your template application then you you can create branches for each instance all in one directory structure. Then a GIT pull will update your application instances. Just a thought[/quote] Thanks for your idea but it's not viable for me. The whole idea is that I want to try to just have a single version of the "template" application files and not have to update the customer ones when I do a change in the "template" due to a significant number of customers. Is there a way to do as I want?
[eluser]Kamarg[/eluser]
It sounds like you're just looking to override certain parts of views but not the logic. If that's the case, you could try something like the below. This allows you to add multiple folders for CodeIgniter to look for views. Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Then in your controller/MY_Controller you just have to do Code: $this->load->add_view_path('path_to_customer_views'); Hope that helps.
[eluser]jjDeveloper[/eluser]
<a href="http://ellislab.com/codeigniter/user-guide/general/cli.html">running codeigniter from command line interface</a> Build yoursel a little tool with this method maybe
[eluser]Jocke[/eluser]
Let me rephrase the problem a bit. What I want really is to add another folder (outside of the application folder) to be looked in for helpers, controllers, libs and so on. Out of the box CI looks for extended classes in the application folder but I would want it to look in another folder as well. Quote:templateapp/ I can define a path in the index.php file for each customer that points to the customerspecific folder but it seems rather hard to extend the loader (and I believe some other classes as well).
[eluser]CroNiX[/eluser]
Sounds like a good candidate for "application packages". Look towards the bottom of the page for the load class. Never tried using it, though. If that doesn't work, you would probably have to extend the load class to search in your additional directories.
[eluser]jjDeveloper[/eluser]
<a href="http://getsparks.org/">Codeigniter Sparks</a> is an awesome way to use packages but you would have a slight learning curve to make one. |
Welcome Guest, Not a member yet? Register Sign In |