在 ZF1 中,我可以执行以下操作以获得 $_POST 和 $_GET 值。
$this->getRequest()->getParam('foo');
ZF2有类似的方法吗?
最佳答案
开箱即用,您不能必须分别检查两者:
$this->getRequest()->getPost('foo'); // $_POST
$this->getRequest()->getQuery('foo'); // $_GET
关于zend-framework2 - ZF2 获取 POST 和 GET 的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15969738/