I m not usind json_encode() - After all, I m able to get JSON data from the controller to my view just fine. The problem is when I make a JSON request from my view to the controller and pass some parameters. It's those params that I cannot access..
On Sep 22, 3:14 am, Donkeybob <[EMAIL PROTECTED]> wrote: > What is your controller code? are you using json_encode in it? > something like this ---> echo json_encode($this->Model- > > >find('all')); > > On Sep 21, 7:24 pm, jkritikos <[EMAIL PROTECTED]> wrote: > > > Hi there, > > > I'm having trouble accessingJSONdata from a controller. (I'm using > > cake version 1.2). MyJSONrequest is as follows: > > > $.getJSON( > > '/locations/find', > > {s1:val1, s2:val2}, > > function callback(data){ > > //doStuff > > > }); > > > I know that theJSONrequest is made just fine because when I tried it > > with empty params I got the response OK. The trouble is that I get > > errors if i try to access the data from the controller using: > > > //$val = $this->params['val']; > > > Do i need to decode theJSONstring? I've tried $this->params, $this->data > > but none seem to do it as they are only used for http POST > > > commands. Note that I m not using any ajax orjsonhelpers/components > > etc. > > > Thanks, > > > jason --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---