Zend framework's getRequest()->getQuery() won't bring query string on localhost

前端 未结 2 1812
无人共我
无人共我 2021-01-06 01:29

I have the following code, which works fine on live site, but not on localhost.

$status = $this->getRequest()->getQuery(\'status\');

2条回答
  •  感动是毒
    2021-01-06 02:00

    I usually use this

    $status = $this->getRequest()->getParam('status');
    
    // or
    $status = $this->getRequest()->getParams();
    

    I assume that you have a Questions Controller Ask Action.
    Here is the documentation about Zend's request

提交回复
热议问题