开发者

how to obtain $_GET object from zend framework

开发者 https://www.devze.com 2023-01-08 06:13 出处:网络
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 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 try开发者_JAVA技巧ing 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?


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消