You are here

public function DefaultWizard::__construct in Flexiform 8

Build the wizard object.

Parameters

\Drupal\Core\TempStore\PrivateTempStoreFactory $tempstore: Tempstore Factory for keeping track of values in each step of the wizard.

\Drupal\Core\Form\FormBuilderInterface $builder: The Form Builder.

\Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver: The class resolver.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: The event dispatcher.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match service.

\Drupal\flexiform_wizard\Entity\Wizard $wizard: The wizard configuration entity.

string|null $step: The current active step of the wizard.

Overrides FormWizardBase::__construct

File

contrib/wizard/src/Wizard/DefaultWizard.php, line 51

Class

DefaultWizard
Provides a default form wizard.

Namespace

Drupal\flexiform_wizard\Wizard

Code

public function __construct(PrivateTempStoreFactory $tempstore, FormBuilderInterface $builder, ClassResolverInterface $class_resolver, EventDispatcherInterface $event_dispatcher, RouteMatchInterface $route_match, WizardEntity $wizard, $step = NULL) {
  parent::__construct($tempstore, $builder, $class_resolver, $event_dispatcher, $route_match, 'flexiform_wizard.' . $wizard
    ->id(), 'flexiform_wizard__' . $wizard
    ->id(), $step);
  $this->wizard = $wizard;
  $provided = [];
  foreach ($this->wizard
    ->get('parameters') as $param_name => $param_info) {
    if ($provided_entity = $route_match
      ->getParameter($param_name)) {
      $provided[$param_name] = $provided_entity;
    }
  }
  $this->provided = $provided;
}