public function FlipbookForm::buildForm in 3D Flipbook 8
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/ FlipbookForm.php, line 19
Class
- FlipbookForm
- Form controller for the content_entity_example entity edit forms.
Namespace
Drupal\flipbook\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
/* @var $entity \Drupal\content_entity_example\Entity\Contact */
$form = parent::buildForm($form, $form_state);
$entity = $this->entity;
$form['langcode'] = [
'#title' => $this
->t('Language'),
'#type' => 'language_select',
'#default_value' => $entity
->getUntranslated()
->language()
->getId(),
'#languages' => Language::STATE_ALL,
];
return $form;
}