private static function checkRoute($arcUrlSeparator, $arsUrlValue)
    {
        $aroRouteList = RouteCollection::getAll();
        if (empty($aroRouteList)) {
            return false;
        }
        foreach ($aroRouteList as $oRoute) {
            // Get route
            $sRoute = $oRoute->getRoute();
            // Remove last char of route if it's a separator
            $sRoute = self::removeLastSeparator($sRoute);
            // Get list of separator for this route
            $arcRouteSeparator = self::listSeparator($sRoute);
            // If URL and route have same number of separator in same position
            if ($arcUrlSeparator == $arcRouteSeparator) {
                // Get list of value of this route
                $arsRouteValueList = self::listValue($sRoute);
                // Valid boolean
                $bGoodRoute = true;
                // Array to store param
                $arsParamList = array();
                // Check each value of url to compare with route
                foreach ($arsRouteValueList as $nParamIndex => $sRouteValue) {
                    if (isset($arsUrlValue[$nParamIndex])) {
                        // Get first char of
                        $cFirstCharValue = substr($sRouteValue, 0, 1);
                        if ($cFirstCharValue == ':') {
                            $arsParamList[substr($sRouteValue, 1)] = $arsUrlValue[$nParamIndex];
                        } elseif ($sRouteValue != $arsUrlValue[$nParamIndex] && $cFirstCharValue != '*') {
                            $bGoodRoute = false;
                        }
                    } else {
                        $bGoodRoute = false;
                    }
                }
                // If valid boolean is true
                if ($bGoodRoute) {
                    // Set controller to route controller
                    self::setController($oRoute->getController());
                    // Set action to route action
                    self::setAction($oRoute->getAction());
                    // Add route param to param list
                    if (is_array($oRoute->getParamList())) {
                        $arsParamList = $arsParamList + $oRoute->getParamList();
                    }
                    // Set param list
                    self::setParameter($arsParamList);
                    // End of check route
                    return true;
                }
            }
        }
        // No route is found
        return false;
    }
private static function checkRoute($arcUrlSeparator, $arsUrlValue)
    {
        $aroRouteList = RouteCollection::getAll();
        if (empty($aroRouteList)) {
            return false;
        }
        foreach ($aroRouteList as $oRoute) {
            // Get route
            $sRoute = $oRoute->getRoute();
            // Remove last char of route if it's a separator
            $sRoute = self::removeLastSeparator($sRoute);
            // Get list of separator for this route
            $arcRouteSeparator = self::listSeparator($sRoute);
            // If URL and route have same number of separator in same position
            if ($arcUrlSeparator == $arcRouteSeparator) {
                // Get list of value of this route
                $arsRouteValueList = self::listValue($sRoute);
                // Valid boolean
                $bGoodRoute = true;
                // Array to store param
                $arsParamList = array();
                // Check each value of url to compare with route
                foreach ($arsRouteValueList as $nParamIndex => $sRouteValue) {
                    if (isset($arsUrlValue[$nParamIndex])) {
                        // Get first char of
                        $cFirstCharValue = substr($sRouteValue, 0, 1);
                        if ($cFirstCharValue == ':') {
                            $arsParamList[substr($sRouteValue, 1)] = $arsUrlValue[$nParamIndex];
                        } elseif ($sRouteValue != $arsUrlValue[$nParamIndex] && $cFirstCharValue != '*') {
                            $bGoodRoute = false;
                        }
                    } else {
                        $bGoodRoute = false;
                    }
                }
                // If valid boolean is true
                if ($bGoodRoute) {
                    // Set controller to route controller
                    self::setController($oRoute->getController());
                    // Set action to route action
                    self::setAction($oRoute->getAction());
                    // Add route param to param list
                    if (is_array($oRoute->getParamList())) {
                        $arsParamList = $arsParamList + $oRoute->getParamList();
                    }
                    // Set param list
                    self::setParameter($arsParamList);
                    // End of check route
                    return true;
                }
            }
        }
        // No route is found
        return false;
    }
private static function checkRoute ( $ arcUrlSeparator , $ arsUrlValue ) { $ aroRouteList = RouteCollection :: getAll ( ) ; if ( empty ( $ aroRouteList ) ) { return false ; } foreach ( $ aroRouteList as $ oRoute ) { // Get route $ sRoute = $ oRoute -> getRoute ( ) ; // Remove last char of route if it's a separator $ sRoute = self :: removeLastSeparator ( $ sRoute ) ; // Get list of separator for this route $ arcRouteSeparator = self :: listSeparator ( $ sRoute ) ; // If URL and route have same number of separator in same position if ( $ arcUrlSeparator == $ arcRouteSeparator ) { // Get list of value of this route $ arsRouteValueList = self :: listValue ( $ sRoute ) ; // Valid boolean $ bGoodRoute = true ; // Array to store param $ arsParamList = array ( ) ; // Check each value of url to compare with route foreach ( $ arsRouteValueList as $ nParamIndex => $ sRouteValue ) { if ( isset ( $ arsUrlValue [ $ nParamIndex ] ) ) { // Get first char of $ cFirstCharValue = substr ( $ sRouteValue , 0 , 1 ) ; if ( $ cFirstCharValue == ':' ) { $ arsParamList [ substr ( $ sRouteValue , 1 ) ] = $ arsUrlValue [ $ nParamIndex ] ; } elseif ( $ sRouteValue != $ arsUrlValue [ $ nParamIndex ] && $ cFirstCharValue != '*' ) { $ bGoodRoute = false ; } } else { $ bGoodRoute = false ; } } // If valid boolean is true if ( $ bGoodRoute ) { // Set controller to route controller self :: setController ( $ oRoute -> getController ( ) ) ; // Set action to route action self :: setAction ( $ oRoute -> getAction ( ) ) ; // Add route param to param list if ( is_array ( $ oRoute -> getParamList ( ) ) ) { $ arsParamList = $ arsParamList + $ oRoute -> getParamList ( ) ; } // Set param list self :: setParameter ( $ arsParamList ) ; // End of check route return true ; } } } // No route is found return false ; }
Check if Route exist in RouterCollection who can match to current url

@since   1.0
@param   array $arcUrlSeparator List of separator of URL.
@param   array $arsUrlValue List of part of URL.
@return  bool True if Route match, else false
Check if Route exist in RouterCollection who can match to current url