private function getRoutesFromIndexActions (&$routes, array &$routeActions, &$requestMethod, array &$requestPathParts) {
        foreach ($routeActions as $routeData) {
            $routePath = $routeData[0];
            $routeAction = $routeData[1];
            $routeParameters = [];
            if (strpos($routePath, self::ROUTE_PARAMETER_PREFIX) !== false || strpos($routePath, self::ROUTE_GENERIC_PATH) !== false) {
                $routePathParts = explode(self::ROUTE_PATH_SEPARATOR, trim($routePath, self::ROUTE_PATH_SEPARATOR));;
                for ($i = 0; $i < sizeof($routePathParts); $i++) {
                    $routePathPart = $routePathParts[$i];
                    if ($routePathPart == self::ROUTE_GENERIC_PATH) {
                        $path = array_slice($requestPathParts, $i);
                        $routeParameters[self::ROUTE_PATH_PARAMETER_NAME] = $path;
                        break;
                    }
                    else if ($routePathPart[0] == self::ROUTE_PARAMETER_PREFIX) {
                        $parameterName = substr($routePathPart, 1);
                        $parameterValue = $requestPathParts[$i];
                        $routeParameters[$parameterName] = $parameterValue;
                    }
                }
            }
            if ($routeAction instanceof RouteGenerator) {
                $route = $routeAction->generateRoute($requestMethod, isset($path)?$path : $requestPathParts);
                if ($route) {
                    $routes[] = $route;
                }
            }
            else {
                $routes[] = new Route($routeAction, $routeParameters);
            }
        }
    }
private function getRoutesFromIndexActions (&$routes, array &$routeActions, &$requestMethod, array &$requestPathParts) {
        foreach ($routeActions as $routeData) {
            $routePath = $routeData[0];
            $routeAction = $routeData[1];
            $routeParameters = [];
            if (strpos($routePath, self::ROUTE_PARAMETER_PREFIX) !== false || strpos($routePath, self::ROUTE_GENERIC_PATH) !== false) {
                $routePathParts = explode(self::ROUTE_PATH_SEPARATOR, trim($routePath, self::ROUTE_PATH_SEPARATOR));;
                for ($i = 0; $i < sizeof($routePathParts); $i++) {
                    $routePathPart = $routePathParts[$i];
                    if ($routePathPart == self::ROUTE_GENERIC_PATH) {
                        $path = array_slice($requestPathParts, $i);
                        $routeParameters[self::ROUTE_PATH_PARAMETER_NAME] = $path;
                        break;
                    }
                    else if ($routePathPart[0] == self::ROUTE_PARAMETER_PREFIX) {
                        $parameterName = substr($routePathPart, 1);
                        $parameterValue = $requestPathParts[$i];
                        $routeParameters[$parameterName] = $parameterValue;
                    }
                }
            }
            if ($routeAction instanceof RouteGenerator) {
                $route = $routeAction->generateRoute($requestMethod, isset($path)?$path : $requestPathParts);
                if ($route) {
                    $routes[] = $route;
                }
            }
            else {
                $routes[] = new Route($routeAction, $routeParameters);
            }
        }
    }
private function getRoutesFromIndexActions ( & $ routes , array & $ routeActions , & $ requestMethod , array & $ requestPathParts ) { foreach ( $ routeActions as $ routeData ) { $ routePath = $ routeData [ 0 ] ; $ routeAction = $ routeData [ 1 ] ; $ routeParameters = [ ] ; if ( strpos ( $ routePath , self :: ROUTE_PARAMETER_PREFIX ) !== false || strpos ( $ routePath , self :: ROUTE_GENERIC_PATH ) !== false ) { $ routePathParts = explode ( self :: ROUTE_PATH_SEPARATOR , trim ( $ routePath , self :: ROUTE_PATH_SEPARATOR ) ) ; ; for ( $ i = 0 ; $ i < sizeof ( $ routePathParts ) ; $ i ++ ) { $ routePathPart = $ routePathParts [ $ i ] ; if ( $ routePathPart == self :: ROUTE_GENERIC_PATH ) { $ path = array_slice ( $ requestPathParts , $ i ) ; $ routeParameters [ self :: ROUTE_PATH_PARAMETER_NAME ] = $ path ; break ; } else if ( $ routePathPart [ 0 ] == self :: ROUTE_PARAMETER_PREFIX ) { $ parameterName = substr ( $ routePathPart , 1 ) ; $ parameterValue = $ requestPathParts [ $ i ] ; $ routeParameters [ $ parameterName ] = $ parameterValue ; } } } if ( $ routeAction instanceof RouteGenerator ) { $ route = $ routeAction -> generateRoute ( $ requestMethod , isset ( $ path ) ? $ path : $ requestPathParts ) ; if ( $ route ) { $ routes [ ] = $ route ; } } else { $ routes [ ] = new Route ( $ routeAction , $ routeParameters ) ; } } }
Obtiene rutas desde las acciones del metodo
@param $routes
@param array $routeActions
@param $requestMethod
@param array $requestPathParts
Obtiene rutas desde las acciones del metodo