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

How to send parameters using Response->redirect?



77.7k
Accepted
answer

I'm afraid there is no utility method for that in response->redirect(). You can pass in parameters as a string:

$this->response->redirect('/my/url/'.join('/',['my','custom','params']));

dispatcher->forward() does accept a params key, although it's not the same as redirect.



85.5k

i think the answer is you cant, but you can redirect to /myroute?param1=yes&param2=no

after that //print_r($_GET);

As an afterthought, if you need named routes you can hook it up with url:

$this->response->redirect($this->url->get([
    'for' => 'namedRoute',
]) . '/' . join('/', ['my','custom','params']));