Welcome Guest, Not a member yet? Register   Sign In
parser loading before views
#1

[eluser]jordanarseno[/eluser]
Has anybody ever had issues with the order that views are displayed when using:
Code:
$this->parser->parse()
?

I have a template that I pass all of my views to in order to achieve header/content/footer.

Using this:

Code:
...
1. $this->load->view("includes/header.php", $main_content)
2. $this->parser->parse($main_content, $parser);
3. $this->load->view("includes/footer.php", $main_content)
...

Actually renders on the page as:

2. parser
1. header
3. footer

Is this how the parser class works? Is it designed to render as the very first view, or is there a way to embed it between views?

Thanks!
#2

[eluser]sooner[/eluser]
i tried it..it worked for me...i don't think the parser class render the view first..i see u are passing $main_content..is that a view name?
#3

[eluser]jordanarseno[/eluser]
hi there,

i got it working by first assigning the $this->parser-parse() function to a variable, and then echoing out that variable. I still don't know why it's happening, but I have a temporary solution Smile

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB