You can do Configure::write(); anywhere in you app... I do it like this: $debugLevel = Configure::read('debug'); Configure::write('debug', 0); [...] //your code Configure::write('debug', $debugLevel);
greets A RhythmicDevil schrieb: > Solved this. The problem was that I had Configure::write('debug', 3); > so there was all sort of extra junk in the response. When I set it to > 0 it works fine. Now I just to figure out how to get debug when I need > it without juggling the config file. > > > > > On Jun 10, 1:44 pm, RhythmicDevil <rhythmicde...@gmail.com> wrote: > >> nope not the Bosstones' song but my AJAX response. >> >> I have a button on the page. Clicking the button invokes the following >> jQuery function: >> >> $('#refresh_sub').click(function() >> { >> console.log('Start'); >> // Add the content to the dialog >> $.post("/subscribers/refresh_sub", '', function(data){ >> console.log('Finish'); >> populate_dialog(data); >> >> $("#confirm_dialog").dialog('option', 'buttons', { >> 'OK': function() >> { >> $("#confirm_dialog").dialog('close') >> } >> }); >> >> $('#confirm_dialog').dialog('open'); >> }, 'json'); >> >> }); >> >> Which in turn invokes the following PHP method in my Subscribers >> Controller: >> >> public function refresh_sub($id = null) >> { >> /* >> * <PerformSubOp> >> * <SubscriberId> subscriber_id </SubscriberId> >> * <Operation> operation </Operation> >> * </PerformSubOp> >> */ >> >> $this->layout = 'ajax'; >> >> $operation = $this->data['operation']; >> >> $id = $this->data['Subscriber']['SubscriberId']; >> $this->TransactionParams['transaction']['id'] . $operation; >> $this->TransactionParams['transaction'] >> ['TransactionCommandList']['TransactionCommand']['PerformSubOp'] >> ['SubscriberId'] = $id; >> $this->TransactionParams['transaction'] >> ['TransactionCommandList']['TransactionCommand']['PerformSubOp'] >> ['Operation'] = $operation; >> >> $result = $this->Subscriber->query('SendTransaction', $this- >> >> >>> TransactionParams); >>> >> $this->set('response', json_encode( array >> ('title'=>'Success', >> 'message'=>'Message content', 'level'=>'Success'))); >> } >> >> The view then does this: >> >> <?php echo $response; ?> >> >> Pretty standard stuff. However my jQuery function never gets the data >> back. If you look you will see I have two console.log() calls the >> jQuery function. The first one fires but the second does not. >> I know that the json data is being returned because I can see it in >> the HTTP response in Firebug. >> >> This basic transaction works in my custom framework. But I am moving >> over to Cake and I am wondering where I went wrong. >> >> Thanks for any help. >> > > > --~--~---------~--~----~------------~-------~--~----~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---