you have to set view to json public $viewClass = 'Json'; something like that :) read manual again :D -- Lep pozdrav, Tilen Majerle http://majerle.eu
2012/4/14 Serkan Sipahi <[email protected]> > Hi all, > > I want to create a JSON response! Scripting my file according to the > manuel: http://book.cakephp.org/2.0/en/views/json-and-xml-views.html > It does not work. I get no response from the server! what am I doing > wrong? > > <?php > class SomeController extends AppController { > > public $components = array( > 'RequestHandler' > ); > > public function index(){ > $this->RequestHandler->setContent('json', 'application/json' ); > $this->set('test', array( > 'Hallo World!', > )); > $this->set('_serialize', array('test')); > } > } > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
