nicolasbeauvais / Walrus

Walrus Framework - Certainly not that big whatever factory.
https://walrus.herokuapp.com
MIT License
46 stars 6 forks source link

No constructor in controller? #43

Closed spark942 closed 10 years ago

spark942 commented 10 years ago

noconstruct on controller1 noconstruct on controller2

nicolasbeauvais commented 10 years ago

Your controller class extend the WalrusController class. if you declare a constructor to your controller, the one in WalrusController isn't invoked and make this error.

To fix this problem you should call the parent constructor in your controller constructor like this:

    public function __construct()
    {
        parent::__construct();

        // Your function
    }

And don't forget to set a visibility to your function (public/protected/private) !

Regards