I am working on a CI + HMVC installation. When I use the HMVC function call:
Modules::run("header");
It prints nothing to screen. However if I run:
echo Modules::run("header");
or:
$x = Modules::run("header");
Then it works.
This is the code that I am trying to make work:
// HOME MODULE
class Home extends MX_Controller{
public function index(){
Modules::run("header");
$this->load->view('home_view');
Modules::run("header");
}
}
// HEADER MODULE
class Header extends MX_Controller{
public function index(){
$this->load->view('header_view');
}
}
// FOOTER MODULE
class Footer extends MX_Controller{
public function index(){
$this->load->view('footer_view');
}
}
But when I run it I only see the "home_view" content. There is no header and no footer.
I cannot use the above approach to solve it, because $this->load->view() is buffered, which makes my "home_view" content appear at the bottom of my HTML, below my footer, and this mangles things.
Please help me find out why Modules:run() will not buffer. Thanks