class Controller_Admin extends Controller_Template { public $template = 'template_admin'; //-------------------------------------------------------------------------------------------------------- public function before() { // Make sure the template system works parent::before(); // Load package auth Fuel::add_package('auth'); // Check for valid login if ( ! Auth::check() and Uri::string() != 'admin/login') { Response::redirect('/admin/login', 'refresh'); } } ...
public function before($data = null)
class Controller_Admin extends Controller_Template { public $template = 'template_admin'; //-------------------------------------------------------------------------------------------------------- [b]public function before($data = null) {[/b] // Make sure the template system works parent::before(); ...
Harro Verton wrote on Sunday 7th of August 2011:I've put a notice in the docs to check the parent definitions when overloading methods.
Please note: if you have a before() method in your template controller extension you must add parent::before(); to that method or the $this->template will not be available. Make sure your before method is compatible with that of the Controller_Template by changing your before() method into before($data = null).
Harro Verton wrote on Sunday 7th of August 2011:Be patient, I haven't commited the change yet. I'm busy with things that pay my bills at the moment. As soon as I commit the change, it will become live on http://fuelphp.com/dev-docs.
I don't know. All I know it that the parent defines it with a parameter. So either it has to go there, or it has to be used when you overload the method...Harro Verton wrote on Sunday 7th of August 2011:I've put a notice in the docs to check the parent definitions when overloading methods.
It looks like you're new here. If you want to get involved, click one of these buttons!