FormInterface.php

Contains \Drupal\Core\Form\FormInterface.

Namespace

Drupal\Core\Form

File

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

/**
 * @file
 * Contains \Drupal\Core\Form\FormInterface.
 */
namespace Drupal\Core\Form;


/**
 * Provides an interface for a Form.
 */
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 array $form_state
   *   An associative array containing the current state of the form.
   *
   * @return array
   *   The form structure.
   */
  public function buildForm(array $form, array &$form_state);

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

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

}

Interfaces

Namesort descending Description
FormInterface Provides an interface for a Form.