Heh, well the fix is actually pretty simple, and it doesn't require
anywhere near a full rewrite, but sure, thanks.  Patches are always
welcome.

On Apr 11, 12:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Yes I do actually. After reviewing the array, my co-worker and I
> noticed the missing Key values from the JSON representation.
> I've begun rewriting your prior Object method. It's parsing correctly
> now however I haven't begun to include the other parameters aside from
> the Data param.
> Give me 15-30 more minutes.
>
> On Apr 11, 12:17 pm, "nate" <[EMAIL PROTECTED]> wrote:
>
> > @firespade: look at the structure.  Notice anything missing?
>
> > On Apr 11, 11:18 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Yes thats a JSON representation of a multidimensional array (wrapped
> > > in braces and blocks).
> > > What were you planning on using this for?
>
> > > On Apr 11, 10:07 am, "Joshua Benner" <[EMAIL PROTECTED]> wrote:
>
> > > > I'm trying to pass PHP data to Javascript (pre-loading data).
>
> > > > It's my understanding that JavascriptHelper::object should generate
> > > > JSON representation of the PHP data passed to it, but I'm
> > > > misunderstanding how to apply the method. Below is the test I ran and
> > > > the unexpected result I get. Is this proper behavior of the function?
>
> > > > This is a sample PHP array with similar structure to what I'm trying
> > > > to JSON-ify:
>
> > > > array(
> > > >         '2007'=>array(
> > > >                 'Spring'=>array(
> > > >                         '1'=>array('id'=>'1','name'=>'Josh'),
> > > >                         '2'=>array('id'=>'2','name'=>'Becky')
> > > >                 ),
> > > >                 'Fall'=>array(
> > > >                         '1'=>array('id'=>'1','name'=>'Josh'),
> > > >                         '2'=>array('id'=>'2','name'=>'Becky')
> > > >                 )
> > > >         ),
> > > >         '2006'=>array(
> > > >                 'Spring'=>array(
> > > >                         '1'=>array('id'=>'1','name'=>'Josh'),
> > > >                         '2'=>array('id'=>'2','name'=>'Becky')
> > > >                 ),
> > > >                 'Fall'=>array(
> > > >                         '1'=>array('id'=>'1','name'=>'Josh'),
> > > >                         '2'=>array('id'=>'2','name'=>'Becky')
> > > >                 )
> > > >         )
> > > > )
>
> > > > And this is the Javascript that it yields:
>
> > > > [{"Spring":[{"id":1, "name":"Josh"}, {"id":2, "name":"Becky"}], "Fall":
> > > > [{"id":1, "name":"Josh"}, {"id":2, "name":"Becky"}]}, {"Spring":[{"id":
> > > > 1, "name":"Josh"}, {"id":2, "name":"Becky"}], "Fall":[{"id":1,
> > > > "name":"Josh"}, {"id":2, "name":"Becky"}]}]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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