CodeIgniter Forums

Full Version: Changing templates location folder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Gewa[/eluser]
I want to change the views folder location from ./system/application/views to the ./templates

can anybody be so kind to tell me where in config I should change the value, so that template class or $this->load->view will take views from ./templates folder in the root of the site????
Thanks

El Forum

[eluser]Jamie Rumbelow[/eluser]
You can set this value in your application's code (AFTER the loader has been initialised) by setting the $_ci_view_path variable on the Loader class:

Code:
$this->load->_ci_view_path = dirname(__FILE__) . '/templates';

El Forum

[eluser]Gewa[/eluser]
this will work on both?
Code:
$this->load->view('something')
and
$this->load->library('parser');



$this->parser->parse('blog_template')

El Forum

[eluser]CroNiX[/eluser]
No, just the view path.

El Forum

[eluser]Gewa[/eluser]
And what to do with parser?