You are here

interface FormInterface in Express 8

Defines the interface for an object oriented form alter.

Hierarchy

Expanded class hierarchy of FormInterface

All classes that implement FormInterface

1 file declares its use of FormInterface
SettingInterface.php in themes/contrib/bootstrap/src/Plugin/Setting/SettingInterface.php
Contains \Drupal\bootstrap\Plugin\Setting\SettingInterface.

File

themes/contrib/bootstrap/src/Plugin/Form/FormInterface.php, line 17
Contains \Drupal\bootstrap\Plugin\Form\FormInterface.

Namespace

Drupal\bootstrap\Plugin\Form
View source
interface FormInterface {

  /**
   * The alter method to store the code.
   *
   * @param array $form
   *   Nested array of form elements that comprises the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param string $form_id
   *   String representing the name of the form itself. Typically this is the
   *   name of the function that generated the form.
   */
  public function alterForm(array &$form, FormStateInterface $form_state, $form_id = NULL);

  /**
   * The alter method to store the code.
   *
   * @param \Drupal\bootstrap\Utility\Element $form
   *   The Element object that comprises the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param string $form_id
   *   String representing the name of the form itself. Typically this is the
   *   name of the function that generated the form.
   */
  public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL);

  /**
   * 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 static function validateForm(array &$form, FormStateInterface $form_state);

  /**
   * Form validation handler.
   *
   * @param \Drupal\bootstrap\Utility\Element $form
   *   The Element object that comprises the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  public static function validateFormElement(Element $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 static function submitForm(array &$form, FormStateInterface $form_state);

  /**
   * Form submission handler.
   *
   * @param \Drupal\bootstrap\Utility\Element $form
   *   The Element object that comprises the form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   */
  public static function submitFormElement(Element $form, FormStateInterface $form_state);

}

Members

Namesort descending Modifiers Type Description Overrides
FormInterface::alterForm public function The alter method to store the code. 2
FormInterface::alterFormElement public function The alter method to store the code. 2
FormInterface::submitForm public static function Form submission handler. 2
FormInterface::submitFormElement public static function Form submission handler. 2
FormInterface::validateForm public static function Form validation handler. 2
FormInterface::validateFormElement public static function Form validation handler. 2