2cafbebfa0285d30bb1da8ec60ad5ec1eeb313b7
[yaffs-website] / web / core / lib / Drupal / Core / Form / FormInterface.php
1 <?php
2
3 namespace Drupal\Core\Form;
4
5 /**
6  * Provides an interface for a Form.
7  *
8  * @ingroup form_api
9  */
10 interface FormInterface {
11
12   /**
13    * Returns a unique string identifying the form.
14    *
15    * @return string
16    *   The unique string identifying the form.
17    */
18   public function getFormId();
19
20   /**
21    * Form constructor.
22    *
23    * @param array $form
24    *   An associative array containing the structure of the form.
25    * @param \Drupal\Core\Form\FormStateInterface $form_state
26    *   The current state of the form.
27    *
28    * @return array
29    *   The form structure.
30    */
31   public function buildForm(array $form, FormStateInterface $form_state);
32
33   /**
34    * Form validation handler.
35    *
36    * @param array $form
37    *   An associative array containing the structure of the form.
38    * @param \Drupal\Core\Form\FormStateInterface $form_state
39    *   The current state of the form.
40    */
41   public function validateForm(array &$form, FormStateInterface $form_state);
42
43   /**
44    * Form submission handler.
45    *
46    * @param array $form
47    *   An associative array containing the structure of the form.
48    * @param \Drupal\Core\Form\FormStateInterface $form_state
49    *   The current state of the form.
50    */
51   public function submitForm(array &$form, FormStateInterface $form_state);
52
53 }