Indicates whether current data from the specified route name.

@param string $routeName

@return bool
@throws \Zend\Session\Exception\InvalidArgumentException
961119
public function isFromRoute($routeName)
    {
        $session = $this->getSession();

        /** @noinspection PhpUndefinedFieldInspection */
        if ($session->data === null || !is_array($session->source)) {
            return null;
        }

        /** @noinspection PhpUndefinedFieldInspection */
        return $session->source['routeName'] === $routeName;
    }
770326
function isCurrentAction( $actionName, $view = '' )
    {
        if ( $view == '' )
            $view = self::currentView();
        if ( $view == '' or $actionName == '' )
            return false;
        return $this->currentAction( $view ) == $actionName;
    }
1355014
public function hasRoutes(string $name): bool{
        return (isset($this->routes[$name]) && !empty($this->routes[$name]));
    }
691467
private function existInArray($items, $routeName): bool
    {
        foreach ($items as $item) {

            if ($item['route'] == $routeName) {
                return true;
            }

            if (array_key_exists('children', $item)) {
                $found = $this->existInArray($item['children'], $routeName);

                if ($found) {
                    return true;
                }
            }
        }

        return false;
    }
20791
public function getRouteFromName(string $routeName) : ?RouteInterface
    {
        foreach ($this->routes as $route) {
            if ($route->getName() == $routeName) {
                return $route;
            }
        }
        return null;
    }
530019
public function has($name)
    {
        $names = is_array($name) ? $name : func_get_args();

        foreach ($names as $value) {
            if (! $this->routes->hasNamedRoute($value)) {
                return false;
            }
        }

        return true;
    }
747039
public function setRoute($routeName, $routeParams = [])
    {
        $this->routeName = $routeName;
        $this->routeParams = $routeParams;
        $this->routeGenerated = null;

        return $this;
    }
782833
private function queueExists($queueName)
    {
        try {
            $this->resolveUrl($queueName);

            return true;
        } catch (\InvalidArgumentException $exception) {
            return false;
        } catch (SqsException $exception) {
            if ($previousException = $exception->getPrevious()) {
                switch ($previousException->getCode()) {
                    case self::AWS_SQS_EXCEPTION_BAD_REQUEST:
                    case self::AWS_SQS_EXCEPTION_NOT_FOUND:
                        return false;
                }
            }

            throw $exception;
        }
    }
120633
public function setName($routeName)
    {
        $lastMethod = $this->lastRouteMethod;
        $lastIndex = count($this->routes[$lastMethod])-1;
        $indexName = $lastMethod.':'.$lastIndex;
        $this->routeNames[$indexName] = $routeName;

        $rota = $this->routes[$lastMethod][$lastIndex];
        $rota->setName($routeName);
        $this->routes[$lastMethod][$lastIndex] = $rota;

        return $this;
    }
1306104
public function getNamedRoute(string $name): Route
    {
        foreach ($this->getRoutes() as $route) {
            if ($route->getName() === $name) {
                return $route;
            }
        }

        throw new InvalidArgumentException('Named route does not exist for name: ' . $name);
    }
346979
public function checkRouteAccess(string $routeName, $user = null): bool
    {
        if ($user instanceof ModelDecoratorInterface) {
            $user = $user->getModel();
        }
        if (is_null($user)) {
            $user = $this->helper->getCurrentUser();
            if (is_null($user)) {
                if (!is_null($this->debugCollector)) {
                    $this->debugCollector->addPermissionCheck(true, 'route', $routeName, $user, [], [], 'No user was available during this permission check (not even an anonymous user). This usually happens during unit testing. Access was therefore automatically granted.');
                }

                return true;
            }
        }

        if (!$routeName) {
            $this->helper->handleError('Error checking route access: the route_name parameter cannot be empty.', ['route' => $routeName, 'user' => $user]);
            if (!is_null($this->debugCollector)) {
                $this->debugCollector->addPermissionCheck(false, 'route', $routeName, $user, [], [], 'There was an error checking the route access and access was therefore automatically denied. Please refer to the error log for more information.');
            }

            return false;
        }
        if (!is_string($user) && !is_object($user)) {
            $this->helper->handleError('Error checking route access: the user parameter must be either a string or an object.', ['route' => $routeName, 'user' => $user]);
            if (!is_null($this->debugCollector)) {
                $this->debugCollector->addPermissionCheck(false, 'route', $routeName, $user, [], [], 'There was an error checking the route access and access was therefore automatically denied. Please refer to the error log for more information.');
            }

            return false;
        }

        $route = $this->router->getRouteCollection()->get($routeName);
        if (is_null($route)) {
            $this->helper->handleError('Error checking route access: the route could not be found.', ['route' => $routeName, 'user' => $user]);
            if (!is_null($this->debugCollector)) {
                $this->debugCollector->addPermissionCheck(false, 'route', $routeName, $user, [], [], 'There was an error checking the route access and access was therefore automatically denied. Please refer to the error log for more information.');
            }

            return false;
        }

        $permissions = $this->getRoutePermissions($routeName);
        $context = ['route' => $routeName, 'user' => $user];
        $access = $this->la->checkAccess($permissions, $context);

        if (!is_null($this->debugCollector)) {
            $this->debugCollector->addPermissionCheck($access, 'route', $routeName, $user, $permissions, $context);
        }

        return $access;
    }
651528
public function extractId($routeName)
    {
        if (!$this->supports($routeName)) {
            return null;
        }

        return (int) str_replace($this->getPrefix(), '', $routeName);
    }
561906
protected function findRouteRecursively($routeName)
    {
        // alias check
        if(is_string($routeName)) {
            if(isset($this->aliasIndices[$routeName])) {
                $routeName = $this->aliasIndices[$routeName];
            } else {
                foreach($this->groupAliasIndices as $alias => $name) {
                    if(strpos($routeName, $alias) === 0) {
                        $routeName = substr_replace($routeName, $name, 0, strlen($alias));
                        break;
                    }
                }
            }
        }

        $routeNames = !is_array($routeName) ? explode('.', $routeName) : $routeName;
        $routeName = array_shift($routeNames);
        $isTag = strpos($routeName, '#') === 0;

        // search by route name
        if(!$isTag)
        {
            // loop this group, and find the route.
            foreach($this->storage as $route)
            {
                if($route->getName() === $routeName)
                {
                    // still has depth
                    if(count($routeNames) > 0)
                        if($route->hasSubroutes())
                            return $route->getSubroutes()->findRouteRecursively($routeNames);
                        else
                            return false;

                    return $route;
                }
            }
        }
        // search by route tag under this group.
        else
        {
            $route = $this->findRouteByTag(substr($routeName, 1));

            if($route)
            {
                if(count($routeNames) > 0)
                    if($route->hasSubroutes())
                        return $route->getSubroutes()->findRouteRecursively($routeNames);
                    else
                        return false;

                return $route;
            }
        }

        return false;
    }
942536
private function resolveRouteOptions(Route $route, $routeName)
    {
        if (null === $cmsOptions = $route->getOption('_cms')) {
            throw new \InvalidArgumentException(sprintf('Route "%s" does not have "_cms" defaults attributes.', $routeName));
        }

        $path = $route->getPath();

        $dynamic = false;
        if (preg_match_all('~\{([^\}]+)\}~', $path, $matches, PREG_SET_ORDER)) {
            foreach ($matches as $match) {
                // If route parameter does not have a default value
                if (!array_key_exists($match[1], $route->getDefaults())) {
                    $dynamic = true;
                    break;
                }
            }
        }

        return $this->optionsResolver->resolve(array_merge($cmsOptions, [
            'path'    => $path,
            'dynamic' => $dynamic,
        ]));
    }
99445
protected function isNotSameRouteHost(Route $route): bool
    {
        if ($this->host === null && $route->getHost() === null) {
            return false;
        }

        if ($this->host === null && $route->getHost() !== null) {
            return true;
        }

        return !$route->isSameHost($this->host, $this->hostConstraints);
    }
226424
private function checkForMetaRoute($route)
    {
        $this->baseRoute = $route;
        $this->metaRoute = null;

        // If route exits in index, use it
        if ($this->mapRoute2IndexKey($route)) {
            return $route;
        }

        // Check for pagination
        $pagination = $this->config["pagination"];
        $matches = [];
        $pattern = "/(.*?)\/($pagination)\/(\d+)$/";
        if (preg_match($pattern, $route, $matches)) {
            $this->baseRoute = $matches[1];
            $this->metaRoute = $route;
            $this->currentPage = $matches[3];
        }

        return $this->baseRoute;
    }
304833
public function getPageBlocksByRouteName($routeName)
    {
        $pageName = $this->routeConfig->getPageName($routeName);

        if (!isset($this->pageBlocks[$pageName])) {
            throw new \Exception(
                sprintf(
                    'Not found blocs for page with name \'%s\' and route name \'%s\'',
                    $pageName,
                    $routeName
                )
            );
        }

        return $this->pageBlocks[$pageName];
    }