@param $routeName

@return string
962383
private function trailingSlash($routeName)
    {
        $routeName = rtrim($routeName, ']');
        $routeName = rtrim($routeName, '[/');
        $missing   = substr_count($routeName, '[') - substr_count($routeName, ']');
        $routeName .= '[/]' . str_repeat(']', $missing);

        return $routeName;
    }
184353
private function prepareRouteRegexp(string $route): string
    {
        if (!array_key_exists($route, self::$parsed_regexp)) {
            self::$parsed_regexp[$route] = preg_replace(array_keys($this->regexp_map), array_values($this->regexp_map), $route);
        }
        return self::$parsed_regexp[$route];
    }
1076449
private function getYmlFileContent(string $fileName = null): string
    {
        $fileName = $fileName ?: $this->routesFile;
        if (!is_file($fileName)) {
            throw new RoutesFileNotFoundException(
                "The routes file '{$fileName}' was not found on your system."
            );
        }

        return file_get_contents($fileName);
    }
893804
public function findOneByRoute($routeName)
    {
        $qb = $this->getQueryBuilder('p');

        return $qb
            ->leftJoin('p.seo', 's')
            ->leftJoin('s.translations', 's_t', Expr\Join::WITH, $this->getLocaleCondition('s_t'))
            ->addSelect('s', 's_t')
            ->andWhere($qb->expr()->eq('p.route', ':route_name'))
            ->getQuery()
            ->setParameter('route_name', $routeName)
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, 'ekyna_cms.page[route:' . $routeName . ']')
            ->getOneOrNullResult();
    }
929120
public function getPageByName($routeName)
    {
        @trigger_error(
            'The '.__METHOD__.' method is deprecated since version 3.2 and will be removed in 4.0.',
            E_USER_DEPRECATED
        );

        $snapshots = $this->getEntityManager()->createQueryBuilder()
            ->select('s')
            ->from($this->class, 's')
            ->where('s.routeName = :routeName')
            ->setParameters([
                'routeName' => $routeName,
            ])
            ->getQuery()
            ->execute();

        $snapshot = \count($snapshots) > 0 ? $snapshots[0] : false;

        if ($snapshot) {
            return new SnapshotPageProxy($this, $snapshot);
        }

        return false;
    }
1251886
public function getRouteGroup(string $groupName)
  {
    foreach ($this->routeGroups as $routeGroup)
    {
      if ( \strcasecmp($routeGroup->getName(),$groupName)==0 ) {
        return $routeGroup;
      }
    }

    return null;
  }
35630
private function removeOptionalFromName($name)
    {
        $this->regex = new Regex(Url::SQUARE_BRACKETS);
        if($matches = $this->regex->getMatches($name))
        {
            /**
             *  th' route has an optional field [/:var] at th' end garr
             *  we'll add it after we've done the rest
             */
            $this->optional = str_replace('/','',$matches[1]);
            $name = str_replace('[/'.$this->optional.']','', $name);
        }
        return $name;
    }
233543
public function getRoute($actionName)
    {
        if (array_key_exists($actionName, $this->routes)){
            return $this->routes[$actionName];
        }
        return false;
    }
279326
private function assembleRouteName() : string
    {
        $prefix = ($this->secure) ? 'secure-api' : 'api';

        $routeName = 'resource';

        if ($this->relatedId !== null) {
            $routeName = 'resource.relationship.item';
        } else {
            if ($this->relationship !== null) {
                $routeName = 'resource.relationship';
            } else {
                if ($this->id !== null) {
                    $routeName = 'resource.item';
                }
            }
        }

        return $prefix . '.' . $routeName;
    }
557963
public function url($routeName, $data = []) {
        $data2 = [];
        $i = 1;

        // Map key (p1, p2, p3....)
        foreach ($data as $value) {
            $data2["p" . $i++] = $value;
        }

        return $this->slim->urlFor("_louisCRUD_" . $routeName, $data2);
    }
1324995
public function getByRouteName($routeName)
    {
        $this->fireLoadEvent();
        if (isset($this->pageTypesByRouteName[$routeName])) {
            return $this->pageTypesByRouteName[$routeName];
        }
    }
343702
private function getRouteByName($routeName)
    {
        if (isset($this->app->router) && $this->app->router instanceof \Laravel\Lumen\Routing\Router) {
            $router = $this->app->router;
        } else {
            // backward compatibility with lumen 5.3
            $router = $this->app;
        }
        foreach ($router->getRoutes() as $route) {
            if (isset($route['action']['as']) && $route['action']['as'] == $routeName) {
                return $route;
            }
        }
        $this->fail("Route with name '$routeName' does not exist");
        return null;
    }
407875
public function route($routeName = null)
    {
        if (null !== $routeName) {
            $this->routeName = $routeName;

            return $this;
        }

        return $this->routeName;
    }
182307
private function getModuleName($route)
    {
        if ($route) {
            if (strpos($route, '/') !== false) {
                [$id] = explode('/', ltrim($route, '/'), 2);
            } else {
                $id = $route;
            }

            return $id;
        }

        return null;
    }
699324
protected function isLegacyAwareRoute($routeName)
    {
        foreach ($this->legacyAwareRoutes as $legacyAwareRoute) {
            if (strpos($routeName, $legacyAwareRoute) === 0) {
                return true;
            }
        }

        return false;
    }
671875
public function getRouteName($name)
    {
        $sectionPrefix = $this->getSection() ? $this->getSection() . '_' : '';

        return sprintf('%s_%s%s_%s', $this->metadata->getApplicationName(), $sectionPrefix, $this->metadata->getName(), $name);
    }
552246
public function generate($routeName, array $params = array())
    {
        // Check if route exists
        if (!isset($this->namedRoutes[$routeName])) {
            throw new Exception("No route with the name $routeName has been found.");
        }

        /** @var \PHPRouter\Route $route */
        $route = $this->namedRoutes[$routeName];
        $url = $route->getUrl();

        // replace route url with given parameters
        if ($params && preg_match_all('/:(\w+)/', $url, $param_keys)) {
            // grab array with matches
            $param_keys = $param_keys[1];

            // loop trough parameter names, store matching value in $params array
            foreach ($param_keys as $key) {
                if (isset($params[$key])) {
                    $url = preg_replace('/:'.preg_quote($key,'/').'/', $params[$key], $url, 1);
                }
            }
        }

        return $url;
    }