On 11 nov, 22:38, Alberto Dominguez
<[email protected]> wrote:
> Hi,
>
> I'm using CakePHP to generate JSON responses. I'm also using FirePHP
> to debug and log the application execution. It works pretty well,
> however when I set the DEBUG level to 2 o higher -i.e. when I need to
> monitor the DB query executions- it suddenly changes the response
> header content type to HTML (Content-Type: text/html).
>
> I'm looking at several files, but I cannot find where it is being
> changed.

http://code.cakephp.org/source/cake/libs/controller/components/request_handler.php#610
>
> Implementation Notes
>
> 1. My JSON implementation is really close to match the one presented
> at  http://www.pagebakers.nl/2007/06/05/using-json-in-cakephp-12/
> 2. CakePHP is successfully debugging and logging to FirePHP -even when
> I change the debug level from 1 to 2.
> 3. FireBug is the tool I use to monitor the HTTP communication
> 4. I'm setting the JSON content type at "RequestHandlerComponent"
> 5. I'm using JSONView extension at Firefox to validate the output
> (obviously it doesn't work when content type is set to text/html

If you're using Firebug, the reason it does this won't be so obvious.
10 points if you can guess/propose a reason.

;)

AD
PS you can put Configure::write('debug', 0); at the end of your layout
to prevent debug output from destroying your data - whilst still being
able to see errors in generation.

--

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=.


Reply via email to