It's a good idea to use pr()…

CakePHP’s built-in wrapper for print_r(), pr() is a nice little function, which is best used for quick debug output.

Reason being, is that if you accidentally forget to remove one call here or there it won’t produce any output if you are in debug = 0 mode (AKA production).

Here it is in all its glory from basics.php:

function pr($var) {
  if (Configure::read() > 0) {
      echo '<pre>';
      echo '</pre>';

There is also a debug() function, which is slightly more robust, but works in a similar fashion.

P.S. Do take a look at basics.php in the core, as it has a couple of other nice utility functions like h(), for example.

… and thanks to AxlF for pointing everyone in the right direction in the manual:

%d bloggers like this: