Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cakephp: pr() not displaying data?

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?

like image 895
chenling Avatar asked Aug 09 '26 04:08

chenling


1 Answers

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

like image 164
Leo Avatar answered Aug 11 '26 20:08

Leo