couldn’t find an answer via search (or google) so i’ll ask it myself.
is it possible to handle JSONP calls to the zend framework?
only found this page:
http://framework.zend.com/wiki/display/ZFPROP/Zend_Json_Server+-+Lode+Blomme
but i’m not sure if it is already implemented!?
thx
JSONP is just a JSON response that is wrapped in a specified callback function that is executed on the client.
Zend_Json_Server is only for JSON-RPC at the moment. The link you found is an archived (unimplemented) proposal to add JSONP support.
The good news is that you don’t need any sort of framework to support JSONP. Assuming
$responseis the data you wish to return to the user, and$callbackcontains the sanitized callback:Tada, you’ve JSONP’d.
Please take care to read the document I linked about sanitizing the callback. Failure to sanitize the callback may result in an exploitable condition.