This is the first post in what is going to be CodeIgniter week here at Eric Barnes. I have been using CodeIgniter a lot and thought it would be good to share some of the tips and tricks I have learned over the past few years. Now with the intro out of the way lets jump in.
Some people, most notably me, want to change where the view files are located in a CodeIgniter application. Here is a quick tip that I do, should you want to make the same change.
For my setup I like to have a template folder in the root to house my view files. So in order to get CodeIgniter to use this directory you have two options.
1. Is to edit system/libraries/Loader.php. Search for and change:
$this->_ci_view_path = 'templates/';
Please note that I assigned the root folder to the php include path.
2. Is a more preferred method and for it you make a copy Loader.php and make the same change above. But put the copy in your application/libraries/ folder. This is a better option because you are not altering any of the core files and upgrades will be easier later on.
Be sure and subscribe to my Feed to get the rest of the CodeIgniter tips.
