>
> [EMAIL PROTECTED]:*
>
Configure::write('debug',0); //When output Json.


Put this line at json's layout.



[]'s

On Wed, Apr 16, 2008 at 4:41 PM, 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 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.
>
> >
>


-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 11 8633 6018
MSN: [EMAIL PROTECTED]
São Paulo - SP/Brazil

--~--~---------~--~----~------------~-------~--~----~
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