Do you know Cake Debug?

Do you develop in Cake? If so – have you ever wondered what that mysterious level 3 debug (with the ‘full object dump’) did?

This was something I have been confused over since the time I started developing with the framework – which is just over a year ago. I would set the level to 3, but never noticed a difference between the output there and the output provided by level 2 debug. I knew I was missing something, but nowhere in the Cake Manual does it elaborate on this setting or what you have to do to make it work.

Then, by chance a few weeks ago I was in the CakePHP chat room on IRC and someone told me about $cakeDebug. Apparently it’s included in the default Cake layout template, but due to my constant template creation (always right off the get go in my development process) I had never known that this needed to manually be included in your layout for the Full Object Dump to appear.

The full code reads:
<?= $cakeDebug ?>

Feel free to place that in the bottom of your custom template – when your Debug settings are set to 2 or lower, you won’t even know it’s there. However, this is the mysterious object that shows you a full object dump on level 3 debug.

Just figure I’d share.

0 Responses to “Do you know Cake Debug?”


  1. No Comments

Leave a Reply