Returns action by associated URI template

@param string $uriTemplate
@throws \RuntimeException if $uriTemplate does not belong to route map
@return string|boolean
336815
public function getActionByURITemplate($uriTemplate)
    {
        $controller = $this->getDataByUriTemplate($uriTemplate, 'controller');
        $separatorPosition = strpos($controller, '@');

        if ($separatorPosition !== false) {
            $action = substr($controller, $separatorPosition + 1);
            return $action;
        } else {
            // No separator
            return false;
        }
    }
124614
private function getUrlPattern(Router $router, $routeNameFromMappingFile, $baseUrl)
    {
        if (!empty($routeNameFromMappingFile)) {
            try {
                $route = $router->getRouteCollection()->get($routeNameFromMappingFile);
                if (empty($route)) {
                    throw new Exception();
                }
            } catch (Exception $e) {
                throw new RuntimeException(
                   \sprintf('Route \'%s\' has not been defined as a Symfony route.', $routeNameFromMappingFile)
               );
            }

            \preg_match_all('/{(.*?)}/', $route->getPath(), $matches);

            $pattern = [];
            if (!empty($matches)) {
                $pattern = \array_combine($matches[1], $matches[0]);
            }

            return $baseUrl.\urldecode($router->generate($routeNameFromMappingFile, $pattern, true));
        }

        return (string) $routeNameFromMappingFile;
    }
1126367
public function get(string $uri, string $controller, string $action)
    {
        $this->addRoute('GET', $uri, $controller, $action);
    }
983878
protected function getRoute($routeName)
    {
        $routeIndex = array_search($routeName, $this->routeNames);
        if ($routeIndex == false) {
            throw new \RuntimeException('Rota '.$routeName.' não encontada');
        } else {
            $split = explode(':', $routeIndex);
            $rota = $this->routes[$split[0]][$split[1]];

            return $rota;
        }
    }
1186636
public static UriTemplate create(String template, boolean encodeSlash, Charset charset) {
    return new UriTemplate(template, encodeSlash, charset);
  }
733123
public function getTemplate($name)
    {
        if (!$this->hasTemplate($name)) {
            throw new \RuntimeException("Template with name \"".$name."\" is not exist");
        }

        $filename = $this->templateMap[$name];

        if (!file_exists($filename)) {
            throw new \RuntimeException("Invalid template filename with name \"".$name."\"");
        }

        return $filename;
    }
1172337
private String pageUri(final UriTemplate uriTemplate, final int pageNumber, final int pageSize) {
        if (pageSize == MAX_VALUE) {
            return uriTemplate.expand();
        }
        return uriTemplate.set(pageNumberVar(), pageNumber).set(pageSizeVar(), pageSize).expand();
    }
457719
public function route($uri = null)
    {
        if ($uri === null) {
            $uri = $this->getAppUri();
        }
        //$uri = ltrim(preg_replace('/^([^&]*)&.*$/', '$1', $uri), '/');
        
        $urlElements = parse_url($uri);
        $uri      = isset($urlElements['path'])     ? $urlElements['path']     : '';
        $query    = isset($urlElements['query'])    ? $urlElements['query']    : null;
        $fragment = isset($urlElements['fragment']) ? $urlElements['fragment'] : null;
        $urlTab = explode('/', trim($uri, ' /'));
        $request = Container::getRequest();
        $request->setUri($uri);
        $request->setBaseUrl($this->getBaseUrl());
        $controller = array_shift($urlTab);
        $action = array_shift($urlTab);
        $request->setController($controller ? $controller : self::DEFAULT_CONTROLLER);
        $request->setAction($action ? $action : self::DEFAULT_ACTION);
        while (count($urlTab)) {
            $key = trim(array_shift($urlTab));
            $value = array_shift($urlTab);
            if ($value !== null) {
                $request->setParam($key, $value);
            }
        }
        if ($query !== null) {
            $params = null;
            parse_str($query, $params);
            foreach ($params as $key => $value) {
                $request->setParam($key, $value);
            }
        }
        
        return $this;
    }
559475
public function get($uri, $action)
    {
        $uri = $this->buildUri($uri);

        return $this->addResponseType(Route::get($uri, $action));
    }
409999
public static Tag uri(String uriTemplate) {
        String uri = StringUtils.hasText(uriTemplate) ? uriTemplate : "none";
        return Tag.of("uri", ensureLeadingSlash(stripUri(uri)));
    }
712661
public function route($method, $uri)
    {
        // Remove subfolder from URI if needed
        $baseDir = $this->get('___.baseDir');
        if ("/" !== $baseDir && 0 === strpos($uri, $baseDir)) {
            $uri = substr($uri, strlen($baseDir));
        }

        // Check which route is being used.
        $routings = $this->routings;
        $this->dispatcher = $this->dispatcher ?: \FastRoute\simpleDispatcher(function(\FastRoute\RouteCollector $r) use ($routings) {
            foreach ($routings as $name => $routing) {
                // 'GET', '/user/{id:\d+}', $routeName
                $r->addRoute($routing[0], $routing[1], $name);
            }
        });

        $routeInfo = $this->dispatcher->dispatch($method, $uri);

        if (\FastRoute\Dispatcher::FOUND === $routeInfo[0]) {
            return array_slice($routeInfo, 1);
        }

        return null;
    }
972176
protected function dispatchRoute($httpMethod, $uri)
    {
        if (isset($this->staticRouteMap[$uri])) {
            return $this->dispatchStaticRoute($httpMethod, $uri);
        }

        return $this->dispatchVariableRoute($httpMethod, $uri);
    }
207447
public function any($methods, $uri, $action = null)
    {
        return $this->addRoute(array_map('strtoupper', (array)$methods), $uri, $action);
    }
738981
public function match($uri)
    {
        foreach ($this->routes as $route) {
            $result = $route->match($uri);

            if ($result == true) {
                return $route;
            }
        }
    }
888171
public static Map<String, String> resolve(final String uri, final String uriTemplate) {
        final String[] parts = URLs.decode(uri).split("/");
        final String[] templateParts = uriTemplate.split("/");
        if (parts.length != templateParts.length) {
            return null;
        }

        final Map<String, String> ret = new HashMap<>();
        for (int i = 0; i < parts.length; i++) {
            final String part = parts[i];
            final String templatePart = templateParts[i];
            if (part.equals(templatePart)) {
                continue;
            }

            String name = StringUtils.substringBetween(templatePart, "{", "}");
            if (StringUtils.isBlank(name)) {
                return null;
            }

            final String templatePartTmp = StringUtils.replace(templatePart, "{" + name + "}", "");
            final String arg = StringUtils.replace(part, templatePartTmp, "");

            ret.put(name, arg);
        }

        return ret;
    }
880825
public function render($matchedURITemplate, array $params = array())
    {
        // For current URI template
        $options = $this->mapManager->getDataByUriTemplate($matchedURITemplate);

        $class = $this->mapManager->getControllerByURITemplate($matchedURITemplate);
        $action = $this->mapManager->getActionByURITemplate($matchedURITemplate);

        return $this->call($class, $action, $params, $options);
    }
592227
public function processTemplateAction($template)
    {
        try {
            if (! empty($template)) {
                // If we have a view in the URL, render this view
                return $this->render($template);
            } elseif (null != $view = $this->getRequest()->get('view')) {
                return $this->render($view);
            }
        } catch (\Exception $ex) {
            return $this->errorPage($ex->getMessage());
        }

        return $this->pageNotFound();
    }