Welcome Guest, Not a member yet? Register   Sign In
Template Parser Question
#1

[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
#2

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

Peter




Theme © iAndrew 2016 - Forum software by © MyBB