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 );
$this->dispatcher->forward( [ 'controller' => 'posts', 'action' => 'index', 'user' => $user ] );
action:
$this->dispatcher->getParam('user');
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.