public function FormsStepsManager::getPreviousStep in Forms Steps 8
Get the forms_steps previous step.
Parameters
mixed $route_name: Current route.
Return value
null|\Drupal\forms_steps\Step Previous Step.
File
- src/
Service/ FormsStepsManager.php, line 139
Class
- FormsStepsManager
- Class FormsStepsManager.
Namespace
Drupal\forms_steps\ServiceCode
public function getPreviousStep($route_name) {
$matches = self::getRouteParameters($route_name);
if ($matches) {
/** @var \Drupal\forms_steps\Entity\FormsSteps $formsSteps */
$formsSteps = FormsSteps::load($matches[1]);
if (!$formsSteps) {
/** @var \Drupal\forms_steps\Step $nextStep */
return $formsSteps
->getPreviousStep($formsSteps
->getStep($matches[2]));
}
}
return NULL;
}