ComplexTestTypeTransitionForm.php

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

Namespace

Drupal\workflow_type_test\Form

File

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

View source
<?php

declare (strict_types=1);
namespace Drupal\workflow_type_test\Form;

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

/**
 * Form to configure the complex test workflow states.
 *
 * @see \Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType
 */
class ComplexTestTypeTransitionForm extends WorkflowTypeTransitionFormBase {
    
    /**
     * {@inheritdoc}
     */
    public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
        $transition = $form_state->get('transition');
        $configuration = $this->workflowType
            ->getConfiguration();
        $form['extra'] = [
            '#type' => 'textfield',
            '#title' => $this->t('Extra'),
            '#description' => $this->t('Extra information added to transition'),
            '#default_value' => $transition && isset($configuration['transitions'][$transition->id()]['extra']) ? $configuration['transitions'][$transition->id()]['extra'] : '',
        ];
        return $form;
    }

}

Classes

Title Deprecated Summary
ComplexTestTypeTransitionForm 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.