[eluser]WanWizard[/eluser]
I don't think this is the way to go.
I would rather opt to create two folders in the views directory, one for browser views, and one for mobile views. Then in your MY_Controller, do
Code:
define('VIEW_DIR', $this->theme->getTheme() ); // returns the name of the views directory, ending with a /
Assuming that your MY_Controller loads and runs before you call your first view, you could use MY_Loader like this:
Code:
function view($view, $vars = array(), $return = FALSE)
{
if ( defined('VIEW_DIR') )
{
parent::view(VIEW_DIR . $view, $vars, $return);
}
else
{
parent::view($view, $vars, $return);
}
}
Then in your controllers you can keep using
Code:
$this->load->view('view_file');
which would load the view_file.php from the directory returned by getTheme().