Skip to content

Instantly share code, notes, and snippets.

@wshayes
Last active December 14, 2015 17:49
Show Gist options
  • Select an option

  • Save wshayes/5124830 to your computer and use it in GitHub Desktop.

Select an option

Save wshayes/5124830 to your computer and use it in GitHub Desktop.
Drupal Debugging Snippets
# Needs Devel Module - shows all defined variables on page
<?php
dpm( get_defined_vars() );
?>
Viewing Node Data Structures
The drush command line and/or the Devel module's Execute PHP code block can be used to display data structures. Here are sample commands for displaying a node object:
drush: drush php-eval "print print_r(node_load(12), 1)"
PHP block: dpr(node_load(12));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment