CodeIgniter Forums
Template Parser Question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Template Parser Question (/showthread.php?tid=7593)



Template Parser Question - El Forum - 04-15-2008

[eluser]Unknown[/eluser]
Hello everyone,

I'm looking into CI the first time and would like to get advice regarding the following:
Code:
class Journal extends Controller {

    function index()
    {
        $this->load->library('parser');

        $data['title'] ='Journal';
        $this->parser->parse('header', $data, false);
        $this->parser->parse('body', $data,false);
        
    }
}
This does not work. Output is the body-view only. It seems the body-view overrides the header-view.

Code:
class Journal extends Controller {

    function index()
    {  
        $this->load->library('parser');
    
        $data['title'] ='Journal';
        echo $this->parser->parse('header', $data, true);
        echo $this->parser->parse('body', $data,true);
        
    }
This works! Is that the usual way to handle parser output or is there a better idiom?

Thanks in advance

Peter


Template Parser Question - El Forum - 04-15-2008

[eluser]Unknown[/eluser]
Found the answer in this thread, sorry for the noise.

Peter