classes/Route.php
public function match($URL, $method='get'){
      $method = strtolower($method);

      // * is an http method wildcard
      if (empty($this->methods[$method]) && empty($this->methods['*'])) return false;

      return (bool) (
        $this->dynamic
           ? preg_match($this->matcher_pattern, '/'.trim($URL,'/'))
           : rtrim($URL,'/') == rtrim($this->pattern,'/')
      );
    }
public function match($URL, $method='get'){
      $method = strtolower($method);

      // * is an http method wildcard
      if (empty($this->methods[$method]) && empty($this->methods['*'])) return false;

      return (bool) (
        $this->dynamic
           ? preg_match($this->matcher_pattern, '/'.trim($URL,'/'))
           : rtrim($URL,'/') == rtrim($this->pattern,'/')
      );
    }
public function match ( $ URL , $ method = 'get' ) { $ method = strtolower ( $ method ) ; // * is an http method wildcard if ( empty ( $ this -> methods [ $ method ] ) && empty ( $ this -> methods [ '*' ] ) ) return false ; return ( bool ) ( $ this -> dynamic ? preg_match ( $ this -> matcher_pattern , '/' . trim ( $ URL , '/' ) ) : rtrim ( $ URL , '/' ) == rtrim ( $ this -> pattern , '/' ) ) ; }
Check if route match on a specified URL and HTTP Method.
@param  [type] $URL The URL to check against.
@param  string $method The HTTP Method to check against.
@return boolean
Check if route match on a specified URL and HTTP Method .