You are here

public function FormWizardBase::getNextParameters in Chaos Tool Suite (ctools) 8.3

The Route parameters for a 'next' step.

If your route requires more than machine_name and step keys, override and extend this method as needed.

Parameters

mixed $cached_values: The values returned by $this->getTempstore()->get($this->getMachineName());.

Return value

array An array keyed by: machine_name step

Overrides FormWizardInterface::getNextParameters

3 calls to FormWizardBase::getNextParameters()
FormWizardBase::actions in src/Wizard/FormWizardBase.php
Generates action elements for navigating between the operation steps.
FormWizardBase::ajaxSubmit in src/Wizard/FormWizardBase.php
FormWizardBase::submitForm in src/Wizard/FormWizardBase.php
Form submission handler.

File

src/Wizard/FormWizardBase.php, line 183

Class

FormWizardBase
The base class for all form wizard.

Namespace

Drupal\ctools\Wizard

Code

public function getNextParameters($cached_values) {

  // Get the steps by key.
  $operations = $this
    ->getOperations($cached_values);
  $steps = array_keys($operations);

  // Get the steps after the current step.
  $after = array_slice($operations, array_search($this
    ->getStep($cached_values), $steps) + 1);

  // Get the steps after the current step by key.
  $after_keys = array_keys($after);
  $step = reset($after_keys);
  if (!$step) {
    $keys = array_keys($operations);
    $step = end($keys);
  }
  return [
    'machine_name' => $this
      ->getMachineName(),
    'step' => $step,
    'js' => 'nojs',
  ];
}