"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/lib/Drupal/Core/Form/FormInterface.php" (26 Nov 2020, 1465 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "FormInterface.php" see the Fossies "Dox" file reference documentation.

    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    * The returned ID should be a unique string that can be a valid PHP function
   16    * name, since it's used in hook implementation names such as
   17    * hook_form_FORM_ID_alter().
   18    *
   19    * @return string
   20    *   The unique string identifying the form.
   21    */
   22   public function getFormId();
   23 
   24   /**
   25    * Form constructor.
   26    *
   27    * @param array $form
   28    *   An associative array containing the structure of the form.
   29    * @param \Drupal\Core\Form\FormStateInterface $form_state
   30    *   The current state of the form.
   31    *
   32    * @return array
   33    *   The form structure.
   34    */
   35   public function buildForm(array $form, FormStateInterface $form_state);
   36 
   37   /**
   38    * Form validation handler.
   39    *
   40    * @param array $form
   41    *   An associative array containing the structure of the form.
   42    * @param \Drupal\Core\Form\FormStateInterface $form_state
   43    *   The current state of the form.
   44    */
   45   public function validateForm(array &$form, FormStateInterface $form_state);
   46 
   47   /**
   48    * Form submission handler.
   49    *
   50    * @param array $form
   51    *   An associative array containing the structure of the form.
   52    * @param \Drupal\Core\Form\FormStateInterface $form_state
   53    *   The current state of the form.
   54    */
   55   public function submitForm(array &$form, FormStateInterface $form_state);
   56 
   57 }