Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In a Drupal form there are three types of callback that are normally necessary to create a form:</p> <ul> <li>The form builder is the function that builds the form using an array the form API understands</li> <li>The form validation handler is the function that validates the values submitted from the users</li> <li>The form submission handler is the function that acts on the values submitted from the users</li> </ul> <p>Of those functions, the one that outputs the result of the calculation done on the values submitted from the users is the last one. Normally, the form submission handler saves the data in the database, and show a message to the users through <a href="http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_set_message/7" rel="nofollow">drupal_set_message()</a>, but it could also simply show the result of the operations done on the entered data.</p> <p>Since Drupal 7, the output of a form submission handler, as well as the output produced from a menu callback, can be a rendering array, and not a string. A rendering array has the pro of being easily altered from third-party modules through <a href="http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_page_build/7" rel="nofollow">hook_page_build()</a>, or <a href="http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_page_alter/7" rel="nofollow">hook_page_alter()</a>.</p> <p><a href="http://api.drupal.org/api/drupal/modules!node!node.module/function/node_view/7" rel="nofollow">node_view()</a> is an example of menu callback that returns a rendering array, and not a string.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload