Welcome Guest, Not a member yet? Register   Sign In
Sendig code from view to variable and not printing
#1

[eluser]fuksito[/eluser]
Is there a way to take all the html code that prints view into variable.
Like

$content = $this->load->view("menu");

And with no printing to the output.

I know about ob_start, ob_end but I don't think this is right way to do.
#2

[eluser]Pascal Kriete[/eluser]
The view function takes a third parameter to do just that. [docs]
Code:
$content = $this->load->view("menu", NULL, TRUE);
#3

[eluser]fuksito[/eluser]
Oh, thanks a lot.




Theme © iAndrew 2016 - Forum software by © MyBB