class Form

Form to test _form routing.

@internal

Hierarchy

  • class \Drupal\router_test\Form

Expanded class hierarchy of Form

25 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.
ContentEntityBase::baseFieldDefinitions in core/lib/Drupal/Core/Entity/ContentEntityBase.php
ContentModerationHooks::theme in core/modules/content_moderation/src/Hook/ContentModerationHooks.php
Implements hook_theme().

... 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 Overrides
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
Form::buildForm public function Form constructor.
Form::getFormId public function Returns a unique string identifying the form.
Form::submitForm public function Form submission handler.
MessengerTrait::$messenger protected property The messenger. 16
MessengerTrait::messenger public function Gets the messenger. 16
MessengerTrait::setMessenger public function Sets the messenger.
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language. 1

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