Redirect to new page w/ POST data (PHP/Zend)

前端 未结 6 575
青春惊慌失措
青春惊慌失措 2020-12-06 10:02

I\'m trying to figure out how to redirect to a new page (different application, controller, action) and maintain the current POST data.

My app is validating the POST

6条回答
  •  Happy的楠姐
    2020-12-06 10:41

    You can use a Controller _request object

    $this->_request->setPost(array(
        'someKey' => 'someValue'
    ));
    

    And then simply use _forward protected method

    $this->_forward('yourAction', 'yourController', 'yourModule');
    

    Then, in forwarded controller action just call

    $aPost = $this->_request->getPost();
    

提交回复
热议问题