Hi guys,

I'm developing an application which uses quite a lot of ajax calls and
I have to say it's a pain in the ass to debug this with cakephp. I use
json to exchange data between client and server and cake's debug
output destroys the json output as you may already know.

A solution you often find on the internet is to disable debug output
altogether when using ajax calls (e.g.:
http://otaqui.com/blog/430/disable-debug-output-for-ajax-in-cakephp/
). What I would really prefer (because I need cake's debug messages)
would be to render the debug output automatically as json if the
current request is an ajax call. Something like this:

$_out = array();
if ($this->RequestHandler->isAjax()) {

   $_out['html'] = $this->output;
   $_out['debug'| = $this->I_DONT_KNOW_THIS_VAR;

   $this->output = json_encode($_out);
}

The problem is - I don't know where (which variable & which callback?)
to catch the debug messages.
I hope you guys can give me a hint!

thanks!
dennis



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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