CodeIgniter Forums
Can I? Move Views - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Can I? Move Views (/showthread.php?tid=7556)



Can I? Move Views - El Forum - 04-14-2008

[eluser]zeedy2k[/eluser]
Is there a way I can move view files into the CI Root folder?? so Public_html-> Views and Public_html->system

?

Cheers
Robert


Can I? Move Views - El Forum - 04-14-2008

[eluser]Pascal Kriete[/eluser]
It is possible, but only in PHP5. You have to extend the Loader. Something like this should work:

libraries/MY_Loader.php:
Code:
class MY_Loader extends CI_Loader {

    function MY_Loader()
    {
        parent::CI_Loader();
        $this->_ci_view_path = APPPATH.'../views/';  //Whatever this is
    }
}



Can I? Move Views - El Forum - 04-15-2008

[eluser]zeedy2k[/eluser]
Excellent... I use php5 and most hosts are supporting that now anyway..

Thanks for the post.