src/Routing/Dispatcher/ClosureDispatcher.php 1 location
|
@@ 45-46 (lines=2) @@
|
| 42 |
|
$this->response->setHeaders(['Content-Type' => 'text/html']); |
| 43 |
|
} |
| 44 |
|
$params = ($this->route->getParameters() == '') ? [] : $this->route->getParameters(); |
| 45 |
|
if(is_array($content = call_user_func_array($this->route->getTarget('closure'), $params))) $this->route->addTarget('data',$content); |
| 46 |
|
elseif(!is_null($content)) $this->response->setContent($content); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
} |
src/Routing/Dispatcher/ControllerDispatcher.php 1 location
|
@@ 51-52 (lines=2) @@
|
| 48 |
|
$dependencies = array_merge($dependencies,($this->route->getParameters() == '') ? [] : $this->route->getParameters()); |
| 49 |
|
if ($this->response->getStatusCode() == 202) |
| 50 |
|
$this->response->setStatusCode(200); |
| 51 |
|
if(is_array($content = $reflectionMethod->invokeArgs($this->getController(), $dependencies))) $this->route->addTarget('data',$content); |
| 52 |
|
elseif(!is_null($content))$this->response->setContent($content); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
|