src/Ubiquity/controllers/Router.php
public static function getRoute($path, $cachedResponse = true) {
		$path = self::slashPath ( $path );
		if (isset ( self::$routes [$path] )) {
			return self::getRoute_ ( self::$routes [$path], $path, [ $path ], $cachedResponse );
		}
		foreach ( self::$routes as $routePath => $routeDetails ) {
			if (preg_match ( "@^" . $routePath . "$@s", $path, $matches )) {
				if (($r = self::getRoute_ ( $routeDetails, $routePath, $matches, $cachedResponse )) !== false) {
					return $r;
				}
			}
		}
		Logger::warn ( "Router", "No route found for {$path}", "getRoute" );
		return false;
	}
public static function getRoute($path, $cachedResponse = true) {
		$path = self::slashPath ( $path );
		if (isset ( self::$routes [$path] )) {
			return self::getRoute_ ( self::$routes [$path], $path, [ $path ], $cachedResponse );
		}
		foreach ( self::$routes as $routePath => $routeDetails ) {
			if (preg_match ( "@^" . $routePath . "$@s", $path, $matches )) {
				if (($r = self::getRoute_ ( $routeDetails, $routePath, $matches, $cachedResponse )) !== false) {
					return $r;
				}
			}
		}
		Logger::warn ( "Router", "No route found for {$path}", "getRoute" );
		return false;
	}
public static function getRoute ( $ path , $ cachedResponse = true ) { $ path = self :: slashPath ( $ path ) ; if ( isset ( self :: $ routes [ $ path ] ) ) { return self :: getRoute_ ( self :: $ routes [ $ path ] , $ path , [ $ path ] , $ cachedResponse ) ; } foreach ( self :: $ routes as $ routePath => $ routeDetails ) { if ( preg_match ( "@^" . $ routePath . "$@s" , $ path , $ matches ) ) { if ( ( $ r = self :: getRoute_ ( $ routeDetails , $ routePath , $ matches , $ cachedResponse ) ) !== false ) { return $ r ; } } } Logger :: warn ( "Router" , "No route found for {$path}" , "getRoute" ) ; return false ; }
Returns the route corresponding to a path

@param string $path The route path
@param boolean $cachedResponse
@return boolean|mixed[]|string
Returns the route corresponding to a path