I want to get some JSON that treats true/false like booleans instead
of strings -- this, they are unquoted.

Cake's JavaScript helper ($javascript->object) handles booleans
without quoting, but unless I specifically typecast the data as
boolean, it looks like a string.

$javascript->object has the ability to specify particular keys to be
left unquoted, such as
e($javascript->object($data=$cm,
                                                $block=true,
                                                $prefix='MJ.cm=',
                                                $postfix=';',
                                                
$stringKeys=array('field1','field5')
                                        ));

This solution, though, doesn't seem any better than specifically type
casting in PHP since I still have to pick out all of the fields to be
unquoted. In fact, now I also have to specify each numeric field to be
unquoted.

So, I know how to get this working. I was wondering, though, if I am
missing a simpler approach. Knowing which fields are booleans seems
like the kind of automagic that cake is really good at.


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