mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-18 17:26:28 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd5d893040 | |||
| 4d58fbf7b5 | |||
| 35bb58818e | |||
| c1512740af |
@@ -27,7 +27,7 @@ class RouterBase {
|
||||
$this->backStack = array();
|
||||
$this->controllerUrlMap = array();
|
||||
$this->baseCsrfVerifier = new BaseCsrfVerifier();
|
||||
$this->request = new Request();
|
||||
$this->request = Request::getInstance();
|
||||
$this->bootManagers = array();
|
||||
|
||||
$csrf = new CsrfToken();
|
||||
@@ -88,7 +88,7 @@ class RouterBase {
|
||||
|
||||
$this->currentRoute = $route;
|
||||
|
||||
if($route instanceof RouterGroup && $route->matchRoute($this->request) && is_callable($route->getCallback())) {
|
||||
if($route instanceof RouterGroup && is_callable($route->getCallback())) {
|
||||
$group = $route;
|
||||
$route->renderRoute($this->request);
|
||||
$mergedSettings = array_merge($route->getMergeableSettings(), $settings);
|
||||
@@ -108,6 +108,8 @@ class RouterBase {
|
||||
|
||||
public function routeRequest() {
|
||||
|
||||
$originalUri = $this->request->getUri();
|
||||
|
||||
// Initialize boot-managers
|
||||
if(count($this->bootManagers)) {
|
||||
/* @var $manager RouterBootManager */
|
||||
@@ -151,6 +153,9 @@ class RouterBase {
|
||||
|
||||
$routeNotAllowed = false;
|
||||
|
||||
$this->request->rewrite_uri = $this->request->uri;
|
||||
$this->request->setUri($originalUri);
|
||||
|
||||
$this->request->loadedRoute = $route;
|
||||
$route->loadMiddleware($this->request);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user