Newer
Older
<?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.
*/
Alex Pott
committed
public function getFormId();
/**
* Form constructor.
*
* @param array $form
* An associative array containing the structure of the form.
Dries Buytaert
committed
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return array
* The form structure.
*/
Dries Buytaert
committed
public function buildForm(array $form, FormStateInterface $form_state);
/**
* Form validation handler.
*
* @param array $form
* An associative array containing the structure of the form.
Dries Buytaert
committed
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
Dries Buytaert
committed
public function validateForm(array &$form, FormStateInterface $form_state);
/**
* Form submission handler.
*
* @param array $form
* An associative array containing the structure of the form.
Dries Buytaert
committed
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
Dries Buytaert
committed
public function submitForm(array &$form, FormStateInterface $form_state);