ComplexTestTypeStateForm.php

Same filename in other branches
  1. 9 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php
  2. 10 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php
  3. 11.x core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php

Namespace

Drupal\workflow_type_test\Form

File

core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php

View source
<?php

namespace Drupal\workflow_type_test\Form;

use Drupal\Core\Form\FormStateInterface;
use Drupal\workflows\Plugin\WorkflowTypeStateFormBase;

/**
 * Form to configure the complex test workflow states.
 *
 * @see \Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType
 */
class ComplexTestTypeStateForm extends WorkflowTypeStateFormBase {
    
    /**
     * {@inheritdoc}
     */
    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;
    }

}

Classes

Title Deprecated Summary
ComplexTestTypeStateForm Form to configure the complex test workflow states.

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