function FormController::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
- 
              core/
modules/ system/ tests/ modules/ condition_test/ src/ FormController.php, line 51  
Class
- FormController
 - Routing controller class for condition_test testing of condition forms.
 
Namespace
Drupal\condition_testCode
public function buildForm(array $form, FormStateInterface $form_state) {
  $form['#tree'] = TRUE;
  $form['entity_bundle'] = [];
  $subformState = SubformState::createForSubform($form['entity_bundle'], $form, $form_state);
  $form['entity_bundle'] = $this->condition
    ->buildConfigurationForm($form['entity_bundle'], $subformState);
  $form['current_theme'] = [];
  $subformState = SubformState::createForSubform($form['current_theme'], $form, $form_state);
  $form['current_theme'] = $this->conditionCurrentTheme
    ->buildConfigurationForm($form['current_theme'], $subformState);
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this->t('Submit'),
  ];
  return $form;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.