CodeIgniter Forums
Changing templates location folder - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Changing templates location folder (/thread-24988.html)



Changing templates location folder - El Forum - 11-26-2009

[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


Changing templates location folder - El Forum - 11-26-2009

[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';



Changing templates location folder - El Forum - 11-26-2009

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



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



Changing templates location folder - El Forum - 11-26-2009

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


Changing templates location folder - El Forum - 11-26-2009

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