function JsWebAssertTestForm::addField

Same name in other branches
  1. 9 core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addField()
  2. 10 core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addField()
  3. 11.x core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php \Drupal\js_webassert_test\Form\JsWebAssertTestForm::addField()
  4. 11.x core/modules/system/tests/modules/jswebassert_test/src/Form/JsWebAssertTestForm.php \Drupal\jswebassert_test\Form\JsWebAssertTestForm::addField()

Ajax callback for the "Add field" button.

File

core/modules/system/tests/modules/js_webassert_test/src/Form/JsWebAssertTestForm.php, line 162

Class

JsWebAssertTestForm
Test form for JSWebAssert JavaScriptTestBase.

Namespace

Drupal\js_webassert_test\Form

Code

public static function addField(array $form, FormStateInterface $form_state) {
    $form['added_field'] = [
        '#type' => 'textfield',
        '#title' => 'Added textfield',
        '#name' => 'added_field',
    ];
    return $form;
}

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