I have a action that returns a JSON and i need to call it from another controller and i need to get this response into a variable to parse the json.
i've tried:
private function makeListFromUrl($menu)
{
$req = new Zend_Controller_Request_Http();
$req->setRequestUri('/module/controller/get.json/');
$res = new Zend_Controller_Response_Http();
$dis = $this->getFrontController()->dispatch($req, $res);
$dis->dispatch($req, $res);
$json = $res->getBody();
return Zend_Json::decode($json);
}
but this code makes the front to render the action, overriding the actual action. i just want to make a request, and get the response into a variable, leaving the actual request untouched.
thanks