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 enter http://localhost/app/users/data dysplay
nothing, but in

http://localhost/app/users/data.json display 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to