framework/web/UrlManager.php
public function parseRequest($request)
    {
        if ($this->enablePrettyUrl) {
            /* @var $rule UrlRule */
            foreach ($this->rules as $rule) {
                $result = $rule->parseRequest($this, $request);
                if (YII_DEBUG) {
                    Yii::debug([
                        'rule' => method_exists($rule, '__toString') ? $rule->__toString() : get_class($rule),
                        'match' => $result !== false,
                        'parent' => null,
                    ], __METHOD__);
                }
                if ($result !== false) {
                    return $result;
                }
            }

            if ($this->enableStrictParsing) {
                return false;
            }

            Yii::debug('No matching URL rules. Using default URL parsing logic.', __METHOD__);

            $suffix = (string) $this->suffix;
            $pathInfo = $request->getPathInfo();
            $normalized = false;
            if ($this->normalizer !== false) {
                $pathInfo = $this->normalizer->normalizePathInfo($pathInfo, $suffix, $normalized);
            }
            if ($suffix !== '' && $pathInfo !== '') {
                $n = strlen($this->suffix);
                if (substr_compare($pathInfo, $this->suffix, -$n, $n) === 0) {
                    $pathInfo = substr($pathInfo, 0, -$n);
                    if ($pathInfo === '') {
                        // suffix alone is not allowed
                        return false;
                    }
                } else {
                    // suffix doesn't match
                    return false;
                }
            }

            if ($normalized) {
                // pathInfo was changed by normalizer - we need also normalize route
                return $this->normalizer->normalizeRoute([$pathInfo, []]);
            }

            return [$pathInfo, []];
        }

        Yii::debug('Pretty URL not enabled. Using default URL parsing logic.', __METHOD__);
        $route = $request->getQueryParam($this->routeParam, '');
        if (is_array($route)) {
            $route = '';
        }

        return [(string) $route, []];
    }
public function parseRequest($request)
    {
        if ($this->enablePrettyUrl) {
            /* @var $rule UrlRule */
            foreach ($this->rules as $rule) {
                $result = $rule->parseRequest($this, $request);
                if (YII_DEBUG) {
                    Yii::debug([
                        'rule' => method_exists($rule, '__toString') ? $rule->__toString() : get_class($rule),
                        'match' => $result !== false,
                        'parent' => null,
                    ], __METHOD__);
                }
                if ($result !== false) {
                    return $result;
                }
            }

            if ($this->enableStrictParsing) {
                return false;
            }

            Yii::debug('No matching URL rules. Using default URL parsing logic.', __METHOD__);

            $suffix = (string) $this->suffix;
            $pathInfo = $request->getPathInfo();
            $normalized = false;
            if ($this->normalizer !== false) {
                $pathInfo = $this->normalizer->normalizePathInfo($pathInfo, $suffix, $normalized);
            }
            if ($suffix !== '' && $pathInfo !== '') {
                $n = strlen($this->suffix);
                if (substr_compare($pathInfo, $this->suffix, -$n, $n) === 0) {
                    $pathInfo = substr($pathInfo, 0, -$n);
                    if ($pathInfo === '') {
                        // suffix alone is not allowed
                        return false;
                    }
                } else {
                    // suffix doesn't match
                    return false;
                }
            }

            if ($normalized) {
                // pathInfo was changed by normalizer - we need also normalize route
                return $this->normalizer->normalizeRoute([$pathInfo, []]);
            }

            return [$pathInfo, []];
        }

        Yii::debug('Pretty URL not enabled. Using default URL parsing logic.', __METHOD__);
        $route = $request->getQueryParam($this->routeParam, '');
        if (is_array($route)) {
            $route = '';
        }

        return [(string) $route, []];
    }
public function parseRequest ( $ request ) { if ( $ this -> enablePrettyUrl ) { /* @var $rule UrlRule */ foreach ( $ this -> rules as $ rule ) { $ result = $ rule -> parseRequest ( $ this , $ request ) ; if ( YII_DEBUG ) { Yii :: debug ( [ 'rule' => method_exists ( $ rule , '__toString' ) ? $ rule -> __toString ( ) : get_class ( $ rule ) , 'match' => $ result !== false , 'parent' => null , ] , __METHOD__ ) ; } if ( $ result !== false ) { return $ result ; } } if ( $ this -> enableStrictParsing ) { return false ; } Yii :: debug ( 'No matching URL rules. Using default URL parsing logic.' , __METHOD__ ) ; $ suffix = ( string ) $ this -> suffix ; $ pathInfo = $ request -> getPathInfo ( ) ; $ normalized = false ; if ( $ this -> normalizer !== false ) { $ pathInfo = $ this -> normalizer -> normalizePathInfo ( $ pathInfo , $ suffix , $ normalized ) ; } if ( $ suffix !== '' && $ pathInfo !== '' ) { $ n = strlen ( $ this -> suffix ) ; if ( substr_compare ( $ pathInfo , $ this -> suffix , - $ n , $ n ) === 0 ) { $ pathInfo = substr ( $ pathInfo , 0 , - $ n ) ; if ( $ pathInfo === '' ) { // suffix alone is not allowed return false ; } } else { // suffix doesn't match return false ; } } if ( $ normalized ) { // pathInfo was changed by normalizer - we need also normalize route return $ this -> normalizer -> normalizeRoute ( [ $ pathInfo , [ ] ] ) ; } return [ $ pathInfo , [ ] ] ; } Yii :: debug ( 'Pretty URL not enabled. Using default URL parsing logic.' , __METHOD__ ) ; $ route = $ request -> getQueryParam ( $ this -> routeParam , '' ) ; if ( is_array ( $ route ) ) { $ route = '' ; } return [ ( string ) $ route , [ ] ] ; }
Parses the user request.
@param Request $request the request component
@return array|bool the route and the associated parameters. The latter is always empty
if [[enablePrettyUrl]] is `false`. `false` is returned if the current request cannot be successfully parsed.
Parses the user request .