src/routing.php
private function find_custom_handler() {
	// get user defined routes
	$routes = $this->get_custom_routes();
	if (empty($routes) || empty($routes[$this->method])) {
		return false;
	}
	
	// catch the non-regex routes first
	if (isset($routes[$this->method][$this->url])) {
		return $routes[$this->method][$this->url];
	}
	
	// find a matching regex
	$handler = false;
	foreach ($routes[$this->method] as $url_regex => $possible_handler) {
		if (preg_match('{^'.$url_regex.'$}', $this->url, $matches)) {
			$handler = $possible_handler;
			
			// save named subpatterns from the regex, to send them through to the handler
			if (strpos($url_regex, '?<') && count($matches) > 1) {
				$this->arguments = $matches;
			}
			break;
		}
	}
	
	return $handler;
}
private function find_custom_handler() {
	// get user defined routes
	$routes = $this->get_custom_routes();
	if (empty($routes) || empty($routes[$this->method])) {
		return false;
	}
	
	// catch the non-regex routes first
	if (isset($routes[$this->method][$this->url])) {
		return $routes[$this->method][$this->url];
	}
	
	// find a matching regex
	$handler = false;
	foreach ($routes[$this->method] as $url_regex => $possible_handler) {
		if (preg_match('{^'.$url_regex.'$}', $this->url, $matches)) {
			$handler = $possible_handler;
			
			// save named subpatterns from the regex, to send them through to the handler
			if (strpos($url_regex, '?<') && count($matches) > 1) {
				$this->arguments = $matches;
			}
			break;
		}
	}
	
	return $handler;
}
private function find_custom_handler ( ) { // get user defined routes $ routes = $ this -> get_custom_routes ( ) ; if ( empty ( $ routes ) || empty ( $ routes [ $ this -> method ] ) ) { return false ; } // catch the non-regex routes first if ( isset ( $ routes [ $ this -> method ] [ $ this -> url ] ) ) { return $ routes [ $ this -> method ] [ $ this -> url ] ; } // find a matching regex $ handler = false ; foreach ( $ routes [ $ this -> method ] as $ url_regex => $ possible_handler ) { if ( preg_match ( '{^' . $ url_regex . '$}' , $ this -> url , $ matches ) ) { $ handler = $ possible_handler ; // save named subpatterns from the regex, to send them through to the handler if ( strpos ( $ url_regex , '?<' ) && count ( $ matches ) > 1 ) { $ this -> arguments = $ matches ; } break ; } } return $ handler ; }
matches the user defined routes

@return mixed $handler see get_handler_type()
matches the user defined routes