문제

I need to access the parameters sent by my ExtJs code in my Zend controller. I tried the following:

  1. $this->getRequest()->getContent() - This gets me the closest to my objective, it returns a key value pair of the parameters. But it is a string, so I can't access the keys.
  2. Created an instance of the Zend Http Request class and tried getQuery, getParams, but no luck.

The method is GET, I found it using getMethod().

This is what I get in my Request object.

[content:protected] => {"method":"getActivities","params":{"controller":"reader","page":1,"skip":0,"limit":50},"jsonrpc":"2.0","id":4} 
)

Is there a way to solve this? I'm really stuck.

도움이 되었습니까?

해결책

Try this.

$content = json_decode($this->getRequest()->getContent()); 
print_r($content);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top