function example_form
example_form(&$form_state, $url)
Form API array definition for the example form.
File
- developer/example.profile, line 273
Code
function example_form(&$form_state, $url) { // This is just a very simple form with one textfield, and a // submit button. $form['example_text'] = array( '#type' => 'textfield', '#title' => st('Testing text'), '#default_value' => '', '#size' => 45, '#maxlength' => 45, '#required' => TRUE, '#description' => st('This is an example form demonstrating forms usage in the installer profiles tasks. Enter any text to see what happens.'), ); $form['continue'] = array( '#type' => 'submit', '#value' => st('Continue'), ); // Note that #action is set to the url passed through from // installer, ensuring that it points to the same page, and // #redirect is FALSE to avoid broken installer workflow. $form['errors'] = array(); $form['#action'] = $url; $form['#redirect'] = FALSE; return $form; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/developer!example.profile/function/example_form/7.x