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 with params

Is there a way to redirect to a page passing params? I have try this below, but not working:

$this->response->redirect('posts/index', $user );

edited 19d ago
    'controller' => 'posts',
    'action' => 'index',
    'user' => $user



edited 18d ago

you cannot pass parameters by HTTP redirect unless the using URL parameters (aka. query string).

$this->response->redirect('posts/index/' . 'someParameter');

Your best bet would be to set a session variable before the redirect, and read it after.

Ok, I got it. But this->dispeacher->forward() flows the content to another action, and when I turn back in the browser, the page is down. Thanks for the answers.