public function routeExist(\Phalcon\Mvc\Router\Route $route) { foreach ($this->getRoutes() as $_route) { if ($_route->getCompiledPattern() == $route->getCompiledPattern() && $_route->getPaths()['controller'] == $route->getPaths()['controller'] && $_route->getPaths()['action'] == $route->getPaths()['action']) { return true; } } return false; }
/** * @param Router\Route $route * @return array */ private function collectParams(Router\Route $route) { $matches = $this->router->getMatches(); $params = []; foreach ($route->getPaths() as $name => $position) { if (isset($matches[$position])) { $params[$name] = $matches[$position]; } } return $params; }