/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Prints out debug information about given variable. * * Only runs if debug level is greater than zero. * * @param boolean $var Variable to show debug information for. * @param boolean $showHtml If set to true, the method prints the debug data in a screen-friendly way. * @param boolean $showFrom If set to true, the method prints from where the function was called. * @link http://book.cakephp.org/view/458/Basic-Debugging */ function debug($var = false, $showHtml = false, $showFrom = true) { if (Configure::read() > 0) { if ($showFrom) { echo ' (line <strong>' . $calledFrom[0]['line'] . '</strong>)'; } echo "\n<pre class=\"cake-debug\">\n"; if ($showHtml) { } echo $var . "\n</pre>\n"; } }
Comments
