Topic

Devel

Devel is a popular developer module containing a variety of developer and debugging utilities that make it more efficient to perform common development tasks. The Devel module includes the Webprofiler, Devel generate and Kint modules. Devel also features Drush integration and provides several custom Drush commands. Devel and its associated submodules are meant to be used on local development environments and should not be enabled on live production sites.

  • As a Devel submodule, Webprofiler can give you insight into a variety of performance-related metrics related to database queries and requests and it can also tell you which route and controller are behind any page on your site.
  • Devel generate is used for generating sample or dummy content like menu items, taxonomy terms, and nodes. The process of using Devel generate to generate content is essentially the same for Drupal 7 and 8.
  • Kint is a variable debugging tool and provides the kint() function, which is a "pretty-print" version of PHP's var_dump() function.
  • The main Devel module also provides the debugging function dpm() which can be used to print out debugging messages in the messages block of a page.

Example tasks

  • Use Webprofiler to learn the names of the routes or controllers responsible for output on any page
  • Quickly generate dummy content (menu items, terms, and nodes) for a development site
  • Use Kint to debug a variable during theme development

Confidence

Devel has been a popular developer module and suite of tools since Drupal 6. As such, learning materials exist for Devel that can be quite dated. In addition, the Drupal 8 version of Devel is still in development (although an RC (release candidate) version does exist) and certain utilities or functions may change. While some utilities (such as Devel generate) operate essentially the same way in Drupal 7 and 8, there are many differences between the Drupal 7 and 8 versions.

Drupalize.Me resources

  • Inspect Variables Available in a Template
    • Demonstrates the use of Kint and other alternative tools to debug variables during theme development.
  • Install Webprofiler and Identify Controllers
    • You'll learn how to use the web debug toolbar and the profiler using Webprofiler. You'll also learn how to reverse engineer a page to find out the names of the controllers responsible for output on that page.
  • Hands-On: Generating Sample Content
    • Though this tutorial uses a Drupal 7 site for its demonstration, the process for generating sample content using Devel generate is essentially the same in Drupal 8.

More Guides

We have guides on many Drupal skills and topics.

Explore guides

External resources

  • Devel (drupal.org)
    • The project page for Devel, which describes the submodules and utilities contained within the project.
  • Drupal 8 Module of the Week: Devel (dev.acquia.com)
    • In this interview, project maintainer Moshe Weitzman describes the main modules inside Devel and how they can be used.