class Form

Form to test _form routing.

@internal

Hierarchy

  • class \Drupal\router_test\Form

Expanded class hierarchy of Form

20 string references to 'Form'
Ckeditor5Hooks::theme in core/modules/ckeditor5/src/Hook/Ckeditor5Hooks.php
Implements hook_theme().
ConfigTargetTest::testNested in core/modules/system/tests/src/FunctionalJavascript/Form/ConfigTargetTest.php
Tests #config_target with callbacks.
ConfigTargetTest::testTree in core/modules/system/tests/src/FunctionalJavascript/Form/ConfigTargetTest.php
Tests #config_target with no callbacks.
ContentModerationHooks::theme in core/modules/content_moderation/src/Hook/ContentModerationHooks.php
Implements hook_theme().
DisplayModeBundleSelectionTest::providerBundleSelection in core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php
Data provider for testBundleSelection().

... See full list

File

core/modules/system/tests/modules/router_test_directory/src/Form.php, line 15

Namespace

Drupal\router_test
View source
class Form extends FormBase {
  
  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'router_test_form';
  }
  
  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) : array {
    $form['submit'] = [
      '#type' => 'submit',
      '#value' => 'Save',
    ];
    return $form;
  }
  
  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) : void {
    $this->messenger()
      ->addStatus('The router_test_form form has been submitted successfully.');
  }

}

Members

Title Sort descending Modifiers Object type Summary
Form::buildForm public function Form constructor.
Form::getFormId public function Returns a unique string identifying the form.
Form::submitForm public function Form submission handler.

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