function example_form

Form API array definition for the example form.

1 string reference to 'example_form'
example_profile_tasks in external_documentation/developer/example.profile
Perform any final installation tasks for this profile.

File

external_documentation/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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.