How to change the Views path in CodeIgniter

Posted by Zahlan on July 26, 2012

Step 1:

open Loader.php file located in ./system/core/loader.php for editing.

Step 2:

Search for $this->_ci_view_paths (since CodeIgniter 2.0 go to line 130) and replace this

<?php $this->_ci_view_paths = array(APPPATH.'views/' => TRUE); ?>

with this code

[php]$this->_ci_view_paths = array(‘your/views/path’ => TRUE);[/php]

Note: you can use FCPATH to go to your CodeIgniter root folder like this

<?php $this->_ci_view_paths = array(FCPATH.'your_views_folder' => TRUE); ?>

That’s it 🙂