You are here

public function ConditionalFieldForm::buildForm in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x src/Form/ConditionalFieldForm.php \Drupal\conditional_fields\Form\ConditionalFieldForm::buildForm()

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 FormInterface::buildForm

File

src/Form/ConditionalFieldForm.php, line 124

Class

ConditionalFieldForm
Class ConditionalFieldForm.

Namespace

Drupal\conditional_fields\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $entity_type = NULL, $bundle = NULL) {
  $this->form = $form;
  $this->form_state = $form_state;
  $this->entity_type = $entity_type;
  $this->bundle_name = $bundle;
  $this->form['entity_type'] = [
    '#type' => 'hidden',
    '#value' => $this->entity_type,
  ];
  $this->form['bundle'] = [
    '#type' => 'hidden',
    '#value' => $this->bundle_name,
  ];
  $this
    ->buildTable();
  return $this->form;
}