| | |
| | | public function __construct(private Router $router, |
| | | private Container $container) { } |
| | | |
| | | public function handle(string $path) { |
| | | $params = $this->router->match($path); |
| | | public function handle(string $path, $method) { |
| | | $params = $this->router->match($path, $method); |
| | | |
| | | if($params === false) { |
| | | throw new PageNotFoundException("No route matched for '$path'"); |
| | | throw new PageNotFoundException("No route matched for '$path' with method '$method'"); |
| | | } |
| | | |
| | | $controller = "App\Controllers\\" . ucwords($params["controller"]); |