I want to serve JSONP content with CakePHP and was wondering what\'s the proper way of doing it so.
Currently I\'m able to serve JSON content automatically by follow
For CakePHP 2.4 and above, you can do this instead.
http://book.cakephp.org/2.0/en/views/json-and-xml-views.html#jsonp-response
So you can simply write:
$this->set('_jsonp', true);
in the relevant action.
Or you can simply write:
/**
*
* beforeRender method
*
* @return void
*/
public function beforeRender() {
parent::beforeRender();
$this->set('_jsonp', true);
}