I’m trying to make a partial output from hmvc module,

1
    $this->obj =& get_instance();

and then I’m trying to load a view from some module,

1
    $this->obj->load->view($view,$data);

This will resulting errors, it turns out $this->obj is only loading the global view of CI i.e. ./application/views/ HMVC is not overriding the default view of CI, you might have to pass your controller object $this from your controller to your layout library,

On your module controller :

1
2
3
4
5
6
7
8
    class Post extends Controller {
        function Post(){
            parent::Controller();
        }
        function Read(){
            $this->layout->load('read.php', $this);
        }
    }

On your Layout library :

1
2
3
4
5
6
7
    function load($view,$controller){
        $partial = $controller->load->view($view,true);

        //parse to your big layout
        $data['content_module'] = $partial;
        $controller->load->view($path_to_layout,$data);
    }

Hope this will help for somebody who have some problem like myself