Skip navigation.
Sponsors
Recent comments
Hidden Drupal development functions

Hidden Drupal development functions

02
Oct
2007

I was browsing around the Devel Module the other day and I noticed a few functions that are not mentioned in any documentation that I've seen but make life even easier, as if Devel doesn't make it easy enough! Almost everyone that's used Devel will be familiar with dprint_r (A debug version of the popular print_r function in PHP). Well who has used these ones?

The dpr simply "saves carpal tunnel syndrome" (as the comment for the function in devel.module says) and the dvr function is funky useful as it not only dumps the data but also the data TYPE too (eg, is this variable a integer zero or boolean false?). The dpm and dvm functions are useful as the message only gets printed out on a visible page. This makes form output debuging easier.

Who here has debug outputted the $form_values on a form_submit and spent a few minutes wondering why nothing came up (due to the redirect after submit) and then ended up adding exit calls to the code to see the output or enabling the form redirection interruption from the Devel Module? Well if you use dpm or dvm then you will get the form output in a message on the next visible page without any workflow interruption! Cool, eh!

These are REALLY useful commands! Thanks to Moshe for adding the var_dump variants and I can only assume it was Moshe's idea to have the shortcut dpr and dpm functions to start with!

I had no idea these existed.

I had no idea these existed. Saves me again some typing! :) Thanks!

Excellent stuff

Brilliant stuff, some excellent Drupal tips that I reckon will save me a bunch of time! Keep up the good Drupal work :)

Thanks

I new these existed, but had forgot the actual function names. Thanks :)

It'd be nice if you asked before taking stuff from my site. Contact me at webmaster [at] thingy - ma - jig . co . uk

This site was based on the Cobalt 2.0 Theme for phpBB written by Jakob Persson

Search
Weblinks

Add to Technorati Favorites

TGC Webring

CMS Drupal Showcase

Feedburner for ThingyMaJig

View Nicholas Thompson's profile on LinkedIn

IconBuffet

Twitter

Become A Fan

bile-edge