class ComplexTestTypeConfigureForm in Drupal 8
Same name and namespace in other branches
- 9 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeConfigureForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeConfigureForm
 
Form to configure the complex test workflow type.
Hierarchy
- class \Drupal\workflows\Plugin\WorkflowTypeConfigureFormBase implements PluginAwareInterface, PluginFormInterface uses StringTranslationTrait
- class \Drupal\workflow_type_test\Form\ComplexTestTypeConfigureForm
 
 
Expanded class hierarchy of ComplexTestTypeConfigureForm
See also
\Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType
File
- core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Form/ ComplexTestTypeConfigureForm.php, line 13  
Namespace
Drupal\workflow_type_test\FormView source
class ComplexTestTypeConfigureForm extends WorkflowTypeConfigureFormBase {
  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $type_configuration = $this->workflowType
      ->getConfiguration();
    $form['example_setting'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Example global workflow setting'),
      '#description' => $this
        ->t('Extra information added to the workflow'),
      '#default_value' => $type_configuration['example_setting'],
    ];
    return $form;
  }
  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    $type_configuration = $this->workflowType
      ->getConfiguration();
    $type_configuration['example_setting'] = $form_state
      ->getValue('example_setting');
    $this->workflowType
      ->setConfiguration($type_configuration);
  }
}