Otaqui.com Blog

CakePHP’s basics.php functions – a series of really useful shortcut functions available globally in your CakePHP app

If you are working with CakePHP and haven’t checked it out yet, it’s very well worth looking through basics.php in the API docs .

As well as adding some PHP 5 functionality on PHP 4 servers, the script also adds a fair number of utility functions to the global namespace, such as:

// similar to print_r(), but dumps to the view and
// is disabled if debug isn't > 0 in config.php
pr($anything); 
// returns the correctly internationalised plural or
// singular depending on locale.
__n($singular, $plural, $count, $return);