function ComplexTestTypeStateForm::buildConfigurationForm

Same name in other branches
  1. 9 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeStateForm::buildConfigurationForm()
  2. 10 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeStateForm::buildConfigurationForm()
  3. 11.x core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeStateForm::buildConfigurationForm()

Overrides PluginFormInterface::buildConfigurationForm

File

core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php, line 18

Class

ComplexTestTypeStateForm
Form to configure the complex test workflow states.

Namespace

Drupal\workflow_type_test\Form

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $state = $form_state->get('state');
    $configuration = $this->workflowType
        ->getConfiguration();
    $form['extra'] = [
        '#type' => 'textfield',
        '#title' => $this->t('Extra'),
        '#description' => $this->t('Extra information added to state'),
        '#default_value' => $state && isset($configuration['states'][$state->id()]['extra']) ? $configuration['states'][$state->id()]['extra'] : '',
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.