interface FormInterface

Defines the interface for an object oriented form alter.

Hierarchy

Expanded class hierarchy of FormInterface

All classes that implement FormInterface

Related topics

1 file declares its use of FormInterface

Namespace

Drupal\bootstrap\Plugin\Form
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

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