route = null; } else { //Test the route from config file try { //load config file $fileLocator = new FileLocator(array(CONFIG_PATH . DIRECTORY_SEPARATOR . 'files')); $loader = new YamlFileLoader($fileLocator); $routes = $loader->load('routing.yml'); //create context $context = new RequestContext('/'); $matcher = new UrlMatcher($routes, $context); // Find the current route $parameters = $matcher->match($_SERVER['REQUEST_URI']); $this->route = $parameters; } catch (ResourceNotFoundException $e) { $this->route = null; } } } }