I have controller which extends Controller_Template, and also i have quite few functions in it, so now i would like to add before() or __construct
But, if i do that i get error from view which says Attempt to assign property of non-object to make it more clear this is the line that gives me error:
$this->template->content = View::factory('pages/all_messages');
So my guess would be that View class have before function, but if that’s the case isn’t before or after functions useless for normal controllers?
Btw i’m using 3.2 version.
You should use before(). Make sure you call
parent::before()at the top of it, and do your code after that. It’s the reverse withafter(). Do your code first, then callparent::after()`.