tags:

views:

48

answers:

3

What are the differences between dpm() and dsm()?

A: 

drupal_set_message() is a Drupal core function that sets messages to be output on the next page view. drupal_print_message() is, I believe (based on the examples I found in Google), something people occasionally say on accident when they actually mean drupal_set_message(), but not a real function.

Note: there is a dpm() function in the devel module, which is short for "drupal print message" that outputs variables for development debugging.

Scott Reynen
Edited my question for clarification. I am using devel.
markdorison
+1  A: 

dsm() is legacy function, it's call dpm() as it is, so you should use dpm().

Nikit
+2  A: 

dpm() prints a variable to the ‘message’ area of the page using drupal_set_message(). The output and compact and less likely to break the layout of your page.

From the devel docs:

A note from the devel module: dsm() is a legacy function that was poorly named; use dpm() instead, since the 'p' maps to 'print_r'.

I think we should trust the devel folks on that one.

friendlydrupal

related questions