I checked it again ,but the problem is always, I test it and find that when call ./post/add.json , the function in post/json/add.ctp not work for me, it means ./post/add.json not associate with ./post/json/ add.ctp , right?
On 4月17日, 上午3时41分, krusty999 <[EMAIL PROTECTED]> wrote: > You must set some variable for te output. > > Controller: > $this->set('myVariable', $this->User->findAll()); > Configure::write('debug',0); //When output Json. > > Then in your view app/views/users/data.ctp you can leave empty. > > But in your view app/view/users/json/data.ctp you put: > <?php > echo $javascript->object($myVariable); //The same of the controller > ?> > > And then when you enterhttp://localhost/app/users/datadysplay > nothing, but in > > http://localhost/app/users/data.jsondisplay the content of > $myVariable in json format. > > See ya. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---