I have the need to load a view from outside the scope of:
$this->load->view();
which appears to work from base/application/vie
Here is a much more straightforward answer that I found on the CodeIgniter forum at https://forum.codeigniter.com/thread-58412.html
This is my ever-so-slight deviation from the solution presented by docmattman:
class MY_Loader extends CI_Loader{
public function __construct()
{
parent::__construct();
}
public function load_ext_view($view, $vars = array(), $return = FALSE)
{
$view_file = '/full/path/to/'.$view.'.php';
if(file_exists($view_file)){
$view_to_load = array('_ci_path' => $view_file,
'_ci_view' => $view,
'_ci_vars' => $this->_ci_object_to_array($vars),
'_ci_return' => $return
);
return $this->_ci_load($view_to_load);
}
return $this->view($view, $vars, $return);
}
}