Welcome Guest, Not a member yet? Register   Sign In
want to use $this->template->render(); with __destruct
#1

[eluser]Unknown[/eluser]
Hi there, I was just wondering if anyone has the codeigniter template system setup so they assign all their views and content to the $template variable and render() on the __destruct of a controller?

Instead of $this->template->render(); in every controller function. I tried doing it on __destruct but it didn't seem to work for me. I haven't had a look at the $template code but was wondering if anyone has tried this?

thanks
#2

[eluser]Dam1an[/eluser]
__deconstruct won't get caled till after the page has been sent to the browser
You could try using a hook




Theme © iAndrew 2016 - Forum software by © MyBB