Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
after() method should accept and return the Controller's response
  • I need to use two apps, one as normal, the other called installer.php My index.php is called installer.php and my fuel/app folder is now fuel/installer - I have updated installer.php to reflect this change. I visit installer.php and all is well. Then I visit installer.php/permissions and I get Warning - 2012-02-03 21:38:50 --> Fuel\Core\Request::execute - The Controller_Installer::after() method should accept and return the Controller's response, empty return for the after() method is deprecated.
    Warning - 2012-02-03 21:38:50 --> Fuel\Core\Request::execute - The Controller_Installer controller should return a string or a Response object, support for the $controller->response object is deprecated. Yet there's nothing in the action at all. Any ideas?
  • It's doing it with the normal app too now. Is there something up with the 1.1/develop branch?
  • Right, figure it out, I've been using Controller_Template for my other apps and this changed. Got it now!
  • No, this has been changed starting 1.1.develop. Your controller action should return a response object, using $this->response is deprecated.
    return \Response::forge(\View::forge('welcome/index'));
    
    Alternatively, you may return something that can be cast as string (like for example a View), which will be wrapped into a Response by the Request object. If your controller action doesn't return anything, or it returns something that can not be cast as string, this error will be logged.
  • I think I was used to being able to leave it blank when using a Template, so that's where my confusion was. Then I got mixed up with .htaccess files and before I knew it I was lying on the floor with foam coming out of my mouth. Going to open a new topic about what I'm trying to achieve!
  • Thomas Edwards wrote on Friday 3rd of February 2012:
    Right, figure it out, I've been using Controller_Template for my other apps and this changed. Got it now!
    Nothing functional has changed there. If your action doesn't return anything, it will use $this->template, which will be wrapped in a Response by the Controller_Template's after() method. It will fail if your controller has an after(), doesn't return a Response, and doesn't return the result of the call to the parent.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion