Quick Tip: are you using pr()?
pr() is a version of print_r() with <pre> tags wrapped around it. It will echo out your array in a human-readable format - without having to view source.
Why is this useful? Well, in the world of CakePHP, everything is an array and eventually you're going to have to do some debugging. Not only is pr() easier to type, it's
Why doesn't pr() work?
Have you set debug mode to zero?
Check your /app/config/core.php for this line:
Configure::write('debug', 0);
Change it to:
Configure::write('debug', 2);
And now you should get some nice debug output at the bottom of every page too.
3 comments:
the pr() is short enough indeed, but it's quite confusing if you are not working with CakePHP framework. That's why I have Macro in my editor which print print_r with pre's with pressing a key combination. and I used to with it. :)
Thanks for another great post. It will surely improve our coding practice. Keep sharing similar stuff.
php programming India
what are the basics steps for learning PHP ?
if you can let me know so i will be thank full to you.
buy facebook app
Post a Comment