Question

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.

Was it helpful?

Solution

Try this.

$content = json_decode($this->getRequest()->getContent()); 
print_r($content);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top