private static function matchRoute($url)
{
foreach (self::$routes as $pattern => $route) {
if (preg_match("@{$pattern}@i", $url, $matches)) {
debug($matches);
foreach ($matches as $k => $v) {
if (is_string($k)) {
$route[$k] = $v;
}
}
if (!isset($route['action'])) {
$route['action'] = 'index';
}
debug($route);
debug($_GET);
self::$route['controller'] = self::upperCamelCase($route['controller']);
self::$route['action'] = self::lowerCamelCase($route['action']);
return true;
}
}
return false;
}