Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZF2 Get value of both POST and GET

In ZF1, I could do following to get both $_POST and $_GET value.

$this->getRequest()->getParam('foo');

Is there any method similar to this in ZF2?

like image 465
htnux Avatar asked Dec 06 '25 06:12

htnux


1 Answers

Out of the box you can't you have to check both separately:

$this->getRequest()->getPost('foo'); // $_POST
$this->getRequest()->getQuery('foo'); // $_GET
like image 109
Andrew Avatar answered Dec 12 '25 04:12

Andrew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!