We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Redirect / Forward

Hello to all,

Im new to Phalconphp, im coming from kohana and laravel frameworks. Im working on a project with phalcon about one week and I'm enjoying it a lot !

One question , $this->response->redirect('controller/action'); or $this->dispatcher->forward() ??


Hi @kadinho

redirect will do an http redirection (with the header location). It means that the browser of the client will change the page. It processes to a new routing (it can also be used to go to another website) and the actual script will end.

forward is internal, the browser of the client wont see any difference, you just execute a different controller.

I hope that's clear enough.



the doubt was in forward but now is clear ! Thank you :)


Just done a schema to be more clear : https://imgur.com/bvJhdEQ


cant open ...