How to change the location of views folder |
[eluser]Unknown[/eluser]
Hi everyone, How can I change the location of views folder? I do not want it to be in the "application/views" folder but to take it out to the root. Thank you
[eluser]InsiteFX[/eluser]
If you do that then you are opening yourself up to having your site hacked! The CI dev version on GitHub allows you to change the view folder in index.php CodeIniter on GitHub
[eluser]Unknown[/eluser]
Thanks for the reply. Why will that open my site for hacks? .htaccess should take care of that and I think this is pretty common request when you want to have some sort of theming support. I do not want always to dig in application/views/something/else when I work on the layout.
[eluser]mejlo[/eluser]
Extend CI_Loader, and in construtor set '_ci_view_paths', for example: Code: $this->_ci_view_paths = array(FCPATH . 'theme' => TRUE,APPPATH.'views/' => TRUE);
[eluser]Aken[/eluser]
[quote author="mejlo" date="1338275100"]Extend CI_Loader, and in construtor set '_ci_view_paths', for example: Code: $this->_ci_view_paths = array(FCPATH . 'theme' => TRUE,APPPATH.'views/' => TRUE); OR you could just change the config item in index.php...
[eluser]CroNiX[/eluser]
If you move your views folder outside of /application you should protect that dir with an htaccess like the one that comes in /application and /system so you can't access it directly via the url. |
Welcome Guest, Not a member yet? Register Sign In |