public function EntityFormController::buildForm

Form constructor.

Parameters

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

array $form_state: An associative array containing the current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

1 call to EntityFormController::buildForm()
ActionFormControllerBase::buildForm in drupal/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php
Form constructor.
1 method overrides EntityFormController::buildForm()
ActionFormControllerBase::buildForm in drupal/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php
Form constructor.

File

drupal/core/lib/Drupal/Core/Entity/EntityFormController.php, line 85
Contains \Drupal\Core\Entity\EntityFormController.

Class

EntityFormController
Base class for entity form controllers.

Namespace

Drupal\Core\Entity

Code

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

  // During the initial form build, add this controller to the form state and
  // allow for initial preparation before form building and processing.
  if (!isset($form_state['controller'])) {
    $this
      ->init($form_state);
  }

  // Retrieve the form array using the possibly updated entity in form state.
  $form = $this
    ->form($form, $form_state);

  // Retrieve and add the form actions array.
  $actions = $this
    ->actionsElement($form, $form_state);
  if (!empty($actions)) {
    $form['actions'] = $actions;
  }
  return $form;
}