You are here

public function ComponentFormBase::buildForm in Module Builder 8.3

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides EntityForm::buildForm

File

src/Form/ComponentFormBase.php, line 126

Class

ComponentFormBase
Base class for Module Builder component forms.

Namespace

Drupal\module_builder\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // Do this here, as the parent method adds the actions to the form, so doing
  // this in the form() method would show those.
  if ($this->sanityException) {

    // Pass the DCB exception to the handler, which outputs the error message.
    ExceptionHandler::handleSanityException($this->sanityException);
    return $form;
  }
  return parent::buildForm($form, $form_state);
}