Library/Think/Http/Route.class.php
/**
     * Convert a URL parameter (e.g. ":id", ":id+") into a regular expression
     * @param  array  $m      URL parameters
     * @return string Regular expression for URL parameter
     */
Convert a URL parameter  into a regular expression
@param  array  $m      URL parameters
@return string Regular expression for URL parameter
Convert a URL parameter into a regular expression @param array $m URL parameters @return string Regular expression for URL parameter
protected function matchesCallback($m) {
        $this->paramNames[] = $m[1];
        if (isset($this->conditions[$m[1]])) {
            return '(?P<' . $m[1] . '>' . $this->conditions[$m[1]] . ')';
        }
        if (substr($m[0], -1) === '+') {
            $this->paramNamesPath[$m[1]] = 1;
            return '(?P<' . $m[1] . '>.+)';
        }
        return '(?P<' . $m[1] . '>[^/]+)';
    }
protected function matchesCallback ( $ m ) { $ this -> paramNames [ ] = $ m [ 1 ] ; if ( isset ( $ this -> conditions [ $ m [ 1 ] ] ) ) { return '(?P<' . $ m [ 1 ] . '>' . $ this -> conditions [ $ m [ 1 ] ] . ')' ; } if ( substr ( $ m [ 0 ] , - 1 ) === '+' ) { $ this -> paramNamesPath [ $ m [ 1 ] ] = 1 ; return '(?P<' . $ m [ 1 ] . '>.+)' ; } return '(?P<' . $ m [ 1 ] . '>[^/]+)' ; }
Convert a URL parameter (e.g.
Convert a URL parameter ( e . g .