Skip to content
Snippets Groups Projects
Commit 98a5f121 authored by Thomas Müller's avatar Thomas Müller
Browse files

To isolate the variable scope used inside the $file it is required in it's own method

parent 5b8c7a01
No related branches found
No related tags found
No related merge requests found
......@@ -117,7 +117,7 @@ class Router implements IRouter {
if (!isset($this->loadedApps[$app])) {
$this->loadedApps[$app] = true;
$this->useCollection($app);
require_once $file;
$this->requireRouteFile($file);
$collection = $this->getCollection($app);
$collection->addPrefix('/apps/' . $app);
$this->root->addCollection($collection);
......@@ -230,4 +230,12 @@ class Router implements IRouter {
return $this->getGenerator()->generate($name, $parameters, $absolute);
}
/**
* To isolate the variable scope used inside the $file it is required in it's own method
* @param $file
*/
private function requireRouteFile($file) {
require_once $file;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment