Welcome Guest, Not a member yet? Register   Sign In
Redirect
#5

(12-06-2018, 12:56 PM)kilishan Wrote: The redirect method returns a RedirectResponse class in CI4, which you must return from your methods. In Home2 it's doing parent::init(), but not returning the RedirectResponse if it is returned.

A second issue you'll run into, though, is that redirects cannot be returned from class constructors now, since we are using a class. You should instead look into using Controller Filters for those type of situations.
This needs to be made clear in the documentation, as I spent a bit of time as well to figure it out...
In the documentation it only mentions that it redirects a response, but doesn't state clearly how you need to handle that response.
Reply


Messages In This Thread
Redirect - by oliver - 12-06-2018, 11:57 AM
RE: Redirect - by kilishan - 12-06-2018, 12:56 PM
RE: Redirect - by Inc33 - 04-25-2020, 01:35 AM
RE: Redirect - by oliver - 12-09-2018, 02:43 AM
RE: Redirect - by InsiteFX - 12-09-2018, 09:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB