The helpers.php and us_helpers.php are filled with all sorts of fun functions (FUNctions?). Over time, all the cool ones will get documented here.
Doing a var_dump on large amounts of data can get messy, so the dump function makes things neat. Instead of concatenating <pre> tags on before and after your var_dump just write…
and you will get back a nice, neat preformatted list of everything that is inside of that variable.
dnd (Dump & Die!)
When you’re tracking down bugs, it’s often a good idea to do a var_dump and then kill the page. The dnd function saves you 4 lines of code by doing a preformatted var_dump and killing the page for you. Simply write…
Outputting test messages can be pretty difficult when you use the dark backgrounds that UserSpice uses by default You often wind up with black on black text. If you need to flash a test message(or any message) on the screen and want to do it in a really simple way use the bold function. It gives you large black text on a white background. All you have to do is
bold("Your message here");
Sometimes you need to be able to echo the name of the page you’re on or save it to the database. The currentPage function will do that for you. To echo it…