I am new to symfony and php zend
I am building RESTws using symfony 1.x and Zend 1.11.6 and PHP
here is my code :
routine.yml --
api_highConfidenceHash:
url: /api/showList.:sf_format
class: sfPropelRoute
param: { module: api, action: showList}
options: { model: showListWS, type: list, method: getDeltaList}
requirements:
sf_format: (?:json)
action.class.php --
public function executeshowList(sfWebRequest $request) {
require_once 'Zend/Rest/Server.php';
$server = new Zend_Rest_Server();
$server->setClass('showList');
$server->handle();
}
showList.class.php --
class showList{
public function getDeltaList($to,$from){
return json_encode(array('to'=>$to,'from'=>$from);
}
Calling WS:
http://localost:9000/test_debug.php/api/showList.json?method=getDeltaList&to=1341705600&from=1341100800
output:
<?xml version="1.0" encoding="UTF-8"?>
<showList generator="zend" version="1.0"><showList><response>{"from":"1341100800","to":"1341705600"}</response><status>success</status></showList></showList>
My requirement is to only the json response output without xml tags , i googled a lot but not able to find solution . Could you please suggest me how can i reponse Ws with only json output.