1. 8.5.x core/lib/Drupal/Core/Form/FormInterface.php
  2. 8.0.x core/lib/Drupal/Core/Form/FormInterface.php
  3. 8.1.x core/lib/Drupal/Core/Form/FormInterface.php
  4. 8.2.x core/lib/Drupal/Core/Form/FormInterface.php
  5. 8.3.x core/lib/Drupal/Core/Form/FormInterface.php
  6. 8.4.x core/lib/Drupal/Core/Form/FormInterface.php
  7. 8.6.x core/lib/Drupal/Core/Form/FormInterface.php

Namespace

Drupal\Core\Form

File

core/lib/Drupal/Core/Form/FormInterface.php
View source
<?php

namespace Drupal\Core\Form;


/**
 * Provides an interface for a Form.
 *
 * @ingroup form_api
 */
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);

}

Interfaces

Namesort descending Description
FormInterface Provides an interface for a Form.