Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

redirect on BaseController

Hi, i've tried to perform a redirect inside the BaseController but it doesn't work. I think this is the default behaviour but i want to know if there is a method to perform the redirect. Actually i'm using this:

header("Location: *url*");
die();

Thank you :)

edited Jul '15

What do you have in basecontroller? an action?

edited Jul '15

for redirect inside controller better use

return $this->response->redirect("url")->send();

https://docs.phalconphp.com/en/latest/reference/response.html#making-redirections

Not an action, simply a function that check something and if it fail i need a redirect.

I've tried to use ->send() method, but doesn't work.

What do you have in basecontroller? an action?



7.8k
Accepted
answer
edited Aug '15

Thank you :)