You are here

public function FormsStepsManager::getStepByRoute in Forms Steps 8

Get the forms_steps step by route.

Parameters

mixed $route_name: Current route.

Return value

null|\Drupal\forms_steps\Step Returns the Step of the route.

File

src/Service/FormsStepsManager.php, line 188

Class

FormsStepsManager
Class FormsStepsManager.

Namespace

Drupal\forms_steps\Service

Code

public function getStepByRoute($route_name) {
  $forms_steps = self::getFormsStepsByRoute($route_name);
  if ($forms_steps) {
    $matches = self::getRouteParameters($route_name);
    if ($matches) {
      return $forms_steps
        ->getStep($matches[2]);
    }
  }
  return NULL;
}