CodeIgniter Forums
Custom and standard view files - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Custom and standard view files (/showthread.php?tid=52965)



Custom and standard view files - El Forum - 07-04-2012

[eluser]Unknown[/eluser]
Hi, I've been using CI for several years now. One thing I'd love to be able to do is to define multiple places where views (and other files, if possible) can come from.

Code:
+ system
| + application
|    +  views
|    +  controllers
|    +  ... etc ...
| custom
| + system
|   + application
|     + views
|     + controllers
|     + ... etc ...

I'm not wedded to this particular structure, but the idea I want is that, when loading a view, it would first look to the custom directory and THEN to the original system directory. The reason is that I want to be able to deploy the same application base to multiple server installations, and be able to place all my installation-specific views etc in the "custom" folder. The idea I'm going for is very similar to the java CLASSPATH (or even plain PHP include_path), where it will look at multiple places for the file.

Now, I can see various ways to do something like this, but all of them involve either hacking CI files, overriding them in non-supported ways, etc. I would like to know if CI has a recommended way of doing this. Thanks for your thoughts.

Gary


Custom and standard view files - El Forum - 07-04-2012

[eluser]Aken[/eluser]
http://ellislab.com/forums/viewthread/220307/

Maybe that touches on what you're looking for.


Custom and standard view files - El Forum - 07-04-2012

[eluser]Unknown[/eluser]
Thank you for the quick reply. Yes, that does exactly what I want. When I upgraded to 2.1.2, I found it. Thanks!