php - How to receive GET request from external source with CakePHP -
i'm working on project allows external users(coming source server) make request page on server, return json encoded data.
for example, data (not using cake, standard php) sent
wwww.example.com/handlerequest.php
i'd have like
if(isset($_get['userrequest'])){ //do stuff echo $json_encoded_stuff; }
with cakephp i'd post data like
www.example.com/handlerequest
however, do not want/need view because there nothing see. page purely data exchange. considering this, there special have cake doesn't throw error because it's expecting corresponding view? possible?
it easy disable both layout , view in cakephp putting following line in controller action:
$this->autorender = false;
if want disable layout, use following line in controller action:
$this->layout = false;
and if want disable view action, use following line in controller:
$this->render(false);
note using $this->layout = false;
, $this->render(false);
in controller action give same results $this->autorender = false;
Comments
Post a Comment