Welcome Guest, Not a member yet? Register   Sign In
Is that possible to load a view which is not in views folder

HI, all

I have some very general view files can be used by different application. I would like to save it in a special folder for different applications to load. With $this->load->view(), it seems not possible. However, is there a work arround to do it? Thank you!


[eluser]Colin Williams[/eluser]
I would have your views folder, or a sub-folder symlink to the other folder.

Or use php include.

You can make a view directory in the system directory and do something like
$this->load->_view_path = BASEPATH.'views/';
$this->load->_view_path = APPPATH.'views/'; // reset class variable for other views
You could extend the loader class with a method to cut down the code in your controller.

[eluser]Phil Sturgeon[/eluser]
The paths can be relative too.

$this->load->_view_path = '../wherever/views/';

Theme © iAndrew 2016 - Forum software by © MyBB