kamikaze_pilot
kamikaze_pilot

Reputation: 14844

how to obtain $_GET object from zend framework

So suppose I have the url:

http://url?x=1&y=2

Then I can just get all the get parameters via PHP using the $_GET variable

so print_r($_GET) will echo all the get variables

Now suppose I'm using zend framework and i'm trying to take advantage of the /var/value/var/value feature:

so now my url is

http://url/controller/action/x/1/y/2

I know how to get the values for individual parameters x and y:

$this->request =  $this->getRequest();
$x = $this->request->getParam('x');

But suppose if I want to get all the GET parameters just like using the $_GET object without Zend framework so that I don't have to access the variable individually....how do I do this within the framework using that newly formatted url?

Upvotes: 3

Views: 4525

Answers (1)

timdev
timdev

Reputation: 62894

If all you want is $_GET, use $request->getQuery()

If you want merged parameters (like getParam() does, use $request->getParams()

Upvotes: 7

Related Questions