CodeIgniter Forums
Templated printed twice - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Templated printed twice (/thread-20924.html)

Templated printed twice - El Forum - 07-25-2009

Hi all, for some reason my template in my project is displayed twice! I've been looking for the bug for a couple of hours now but I'm completely out of ideas!

I'd really appreciate if someone could have a look at it.

First of all this is what happens:

Now the more interesting part, code:

My controller:
My parser lib:

View files:


I know that's a lot of code but still, my whole page gets that bug and I just don't know why Sad.

Please help a CodeIgniter Newbie!

Templated printed twice - El Forum - 07-25-2009

[eluser]Colin Williams[/eluser]
You are consistently sending $this->parser->parse() a FOURTH parameter of TRUE. It's the THIRD parameter that needs to be TRUE (as in, === TRUE). It looks like you are trying to send a $data array second and another array of data third. You need to combine $data and $this->cond. Actually, in your constructor just do $this->load->vars($this->cond) and then you don't need to pass it to every parse method (unless this is only true for regular views. I'm not super knowledgeable in regards to the Template Parser class).

Templated printed twice - El Forum - 07-26-2009

Erm I pass 4 arguments because I hacked the parser class to allow 'conditional' template tags which are the third param. That third param isnt' $this->cond all the time either, so I don't think that's the problem.

Anyway I'll try to completely get rid of parser and just use views. CI's template engine isn't really useful anyway.

Templated printed twice - El Forum - 07-26-2009

[eluser]Colin Williams[/eluser]
I think it isnt useful because of your code? Might be where your issue is