W3cubDocs

/Drupal 8

public function EntityForm::form

public EntityForm::form(array $form, FormStateInterface $form_state)

Gets the actual form array to be built.

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

core/lib/Drupal/Core/Entity/EntityForm.php, line 147

Class

EntityForm
Base class for entity forms.

Namespace

Drupal\Core\Entity

Code

public function form(array $form, FormStateInterface $form_state) {
  // Add #process and #after_build callbacks.
  $form['#process'][] = '::processForm';
  $form['#after_build'][] = '::afterBuild';

  return $form;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityForm.php/function/EntityForm::form/8.1.x