src/Routing/Dispatcher/ControllerDispatcher.php 1 location
|
@@ 41-43 (lines=3) @@
|
| 38 |
|
public function call() |
| 39 |
|
{ |
| 40 |
|
|
| 41 |
|
if (!class_exists($this->router->route->getTarget('controller'))) { |
| 42 |
|
throw new \Exception('Class not found : "' . $this->router->route->getTarget('controller') . '"'); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
$classInstance = [ |
| 46 |
|
Route::class => $this->router->route, |
src/Routing/Dispatcher/TemplateDispatcher.php 1 location
|
@@ 42-44 (lines=3) @@
|
| 39 |
|
*/ |
| 40 |
|
public function call() |
| 41 |
|
{ |
| 42 |
|
if (!is_file($this->router->route->getTarget('template'))) { |
| 43 |
|
throw new \Exception('Template file not found : "' . $this->router->route->getTarget('template') . '"'); |
| 44 |
|
} |
| 45 |
|
$this->setContentType($this->router->route->getTarget('extension')); |
| 46 |
|
if (isset($this->router->route->getTarget('callback')[$this->router->route->getTarget('extension')])) { |
| 47 |
|
$this->router->response->setContent(call_user_func_array($this->router->route->getTarget('callback')[$this->router->route->getTarget('extension')], [$this->router->route])); |