I have set the debug mode to 2:
Configure::write('debug', 2);
I tried to use pr() in my controller, it didnt display anything a.k.a blank:
pr($this->data);
But, if I use print_r($this->data), it can display the data. Why my pr() is not working?
just before you do the pr()
echo Configure::read();
This should return your current debug level, if it is zero, its not being set correctly. Hence debug() or pr() wont work as they rely on debug being greater than 0.
FYI the default behaviour in CakePHP 2 will require you to specify Configure::read('debug'); to get the debug level
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With