foreach ($arr as $key => $value) {
$route = '#^' . $key . '$#';
$this->routes[$route] = $value;
}
foreach ($this->routes as $route => $params) {
if (preg_match($route, $url, $matches)) {
$this->params = $params;
if (isset($this->params['folder'])) {
$this->params['folder'] = '\\' . ucfirst($this->params['folder']);
}
return true;
}
}