[eluser]Unknown[/eluser]
Hello
I am trying to integrate the wonderful HMVC library into my code igniter 2 application but i have some trouble to use a custom layout library inside hmvc modules .
Each time i want to load a view located outside the module view folder i get the unable to load file error .
here's an example of the problem :
here's a module controller
Code:
class User extends MX_Controller {
public function register() {
$viewData['captcha'] = $this->load->module('captcha/captcha');
//generate a file not found error
return $this->layout->partialView('register.php', $viewData);
}
}
here's my layout library
Code:
class Layout
{
private $_ci = NULL;
private $_var = array();
public function __construct()
{
$this->_ci = & get_instance();
$this->_var['output'] = '';
}
public function partialView($name, $data=array())
{
$this->_var['output'] = $this->_ci->load->view($name, $data, false);
//wrap the result inside a custom view
$this->_ci->_load->view('layout/default/partial.php', $this->_var);
}
When i try to load the view using mx_loader inside my layout library it seems that that the reference stored inside $this->_ci->load is set to the mx loader of the captcha module and not the user module . Can you show me a way to get the current loader instance inside my library ?