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

前端 未结 2 1798
无人共我
无人共我 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 01:48

    For those looking for the solution to ZF2 - look at this post, helped me out dramatically. It even includes the reference to a phenomenal plugin to make this easier (as the very least, in understanding the routes/requests/params, etc...)

    Getting $_GET parameters from route in Zend Framework 2

    Also, in this post SO post

    How to access route, post, get etc. parameters in Zend Framework 2

    In short, tho -

        $this->getRequest()->getRequest('name', 'default');
        $this->getEvent()->getRouteMatch()->getParam('name', 'default');
    

提交回复
热议问题