Otaqui.Com

Pete Otaqui’s blog about web development and everything else

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

leave a comment

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);

Written by pete

February 24th, 2009 at 10:07 pm

Posted in Professional

Tagged with

Leave a Reply