function FormInterface::buildForm

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Form/FormInterface.php \Drupal\Core\Form\FormInterface::buildForm()
  2. 10 core/lib/Drupal/Core/Form/FormInterface.php \Drupal\Core\Form\FormInterface::buildForm()
  3. 8.9.x core/lib/Drupal/Core/Form/FormInterface.php \Drupal\Core\Form\FormInterface::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

32 methods override FormInterface::buildForm()
AddBlockForm::buildForm in core/modules/layout_builder/src/Form/AddBlockForm.php
Builds the form for the block.
AddFormBase::buildForm in core/modules/media_library/src/Form/AddFormBase.php
Form constructor.
AjaxFormsTestValidationForm::buildForm in core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php
Form constructor.
AjaxTestFocusFirstForm::buildForm in core/modules/system/tests/modules/ajax_test/src/Form/AjaxTestFocusFirstForm.php
Form constructor.
ConfigTranslationFormBase::buildForm in core/modules/config_translation/src/Form/ConfigTranslationFormBase.php
Implements \Drupal\Core\Form\FormInterface::buildForm().

... See full list

File

core/lib/Drupal/Core/Form/FormInterface.php, line 35

Class

FormInterface
Provides an interface for a Form.

Namespace

Drupal\Core\Form

Code

public function buildForm(array $form, FormStateInterface $form_state);

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