gear/Routing/Route.php
/**
     * Check if url passed mathced with route.
     *
     * @param string $url URL.
     *
     * @return boolean True if url matched, false otherwise.
     */
Check if url passed mathced with route.
@param string $url URL.

@return boolean True if url matched, false otherwise.
Check if url passed mathced with route . @param string $url URL . @return boolean True if url matched false otherwise .
public function match($url)
    {
        $this->matches = [];
        $url = trim($url, '/');
        $path = preg_replace_callback('#:([\w]+)#', [$this, 'matchParams'], $this->path);
        if (!preg_match("#^$path$#i", $url, $matches)) {
            return false;
        }
        array_shift($matches);
        $this->matches = $matches;
        return true;
    }
public function match ( $ url ) { $ this -> matches = [ ] ; $ url = trim ( $ url , '/' ) ; $ path = preg_replace_callback ( '#:([\w]+)#' , [ $ this , 'matchParams' ] , $ this -> path ) ; if ( ! preg_match ( " #^ $ path $#i " , $ url , $ matches ) ) { return false ; } array_shift ( $ matches ) ; $ this -> matches = $ matches ; return true ; }
Check if url passed mathced with route.
Check if url passed mathced with route .