Drupal Common development tool (i)--devel module

Source: Internet
Author: User
Tags drupal

There are many modules and tools available for Drupal development, the two most commonly used are Devel and Drupal for Firebug. This article and the Drupal Common development tool (ii)--drupal for Firebug are described separately.

A lot of content related to this article can be viewed through the Devel Demo module, if there is correction or supplement can be posted in the official issue queue, you can also leave a message after this article.

Devel module

Devel A collection of multiple development auxiliary modules, in addition to being the core Devel module, the Devel module package also contains other submodules, such as Devel Generate can be used to generate test content, terminology and users. (Note that the theme Developer module has been detached from the Devel module as a separate module)

Devel sub-modules are not covered in this article, and you can read the relevant documentation on the project page if you are interested.

DPM ()

Use the Drupal_set_message () function to display variables in the ' message ' area of the page. With this function, variables can be tracked. Because the Devel module now displays the variables using Krumo, the output will become more complex.

dpm($input, $name = NULL);

If for some reason you are not using Krumo, you can use $name parameters to differentiate between different DPM () calls.

DVM ()

Use the Drupal_set_message () function to display the results of the var_dump () function processing variables in the ' message ' position. The output of this function is more difficult to read than the results of the Krumo-based DPMT () function, but it is easy to copy and paste with it.

dvm($input, $name = NULL);

DPR ()

Displaying variables in a readable format at the head of the page (without using Krumo) is a good choice for topics that do not have $message variables.

dpr($input, $return = FALSE, $name = NULL);

Setting the $return parameter to True will display the data returned with the result of the function without printing.

DVR ()

It is basically the same as DPR (), but the output is obtained by the Var_dump () function.

KPR ()

Similar to DPM (), it simply shows the output in Krumo form at the top of the page, and applies to cases where there are no $message variables in the page template.

Dargs ()

Outputs the parameter values passed into the current route function. For example, the parameters are ' foo ' and ' 42 ' respectively. You can use this function to confirm when you are not sure what parameters the Drupal routing function is currently receiving. In fact, the result of the Drupal kernel args () function is displayed on the page)


DD ()

The variables are recorded in a record file named Drupal_debug.txt in the Temp directory, and all the output of this function is appended to the record file, so that the developer can keep track of changes in the variables.

    • If you use Mac OS X, you can use logging console to view the contents of the log file.
    • If you are using Linux, you can use the ' tail–f drupal_debug.txt ' command to view the recorded data.

dd($data, $label = NULL)

Ddebug_backtrace ()

Print function Call stack

Db_queryd ()

This function is a debug version of Db_query () that can display database query results or error messages to the browser. It is useful when you want to monitor some database request information, but do not want to list all database requests made by the current page.

db_queryd($query, $args = array());

The original title: "Drupal Common development tool (a)--devel module"

Original address: http://drupalct.org/drupal-development/drupal-development-module-devel.html

Drupal Common development tool (i)--devel module

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.