You are here

interface FormInterface in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Form/FormInterface.php \Drupal\Core\Form\FormInterface

Provides an interface for a Form.

Hierarchy

Expanded class hierarchy of FormInterface

All classes that implement FormInterface

Related topics

21 files declare their use of FormInterface
AjaxFormBlock.php in core/modules/system/tests/modules/ajax_forms_test/src/Plugin/Block/AjaxFormBlock.php
Contains \Drupal\ajax_forms_test\Plugin\Block\AjaxFormBlock.
BlockListBuilder.php in core/modules/block/src/BlockListBuilder.php
Contains \Drupal\block\BlockListBuilder.
DbLogFormInjectionTest.php in core/modules/dblog/src/Tests/DbLogFormInjectionTest.php
Contains \Drupal\dblog\Tests\DbLogFormInjectionTest.
DraggableListBuilder.php in core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
Contains \Drupal\Core\Config\Entity\DraggableListBuilder.
EntityAutocompleteElementFormTest.php in core/modules/system/src/Tests/Entity/Element/EntityAutocompleteElementFormTest.php
Contains \Drupal\system\Tests\Entity\Element\EntityAutocompleteElementFormTest.

... See full list

File

core/lib/Drupal/Core/Form/FormInterface.php, line 15
Contains \Drupal\Core\Form\FormInterface.

Namespace

Drupal\Core\Form
View source
interface FormInterface {

  /**
   * Returns a unique string identifying the form.
   *
   * @return string
   *   The unique string identifying the form.
   */
  public function getFormId();

  /**
   * Form constructor.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   *
   * @return array
   *   The form structure.
   */
  public function buildForm(array $form, FormStateInterface $form_state);

  /**
   * Form validation handler.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  public function validateForm(array &$form, FormStateInterface $form_state);

  /**
   * Form submission handler.
   *
   * @param array $form
   *   An associative array containing the structure of the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  public function submitForm(array &$form, FormStateInterface $form_state);

}

Members

Namesort descending Modifiers Type Description Overrides
FormInterface::buildForm public function Form constructor. 157
FormInterface::getFormId public function Returns a unique string identifying the form. 212
FormInterface::submitForm public function Form submission handler. 167
FormInterface::validateForm public function Form validation handler. 20