gata basic ul
This commit is contained in:
@@ -18,6 +18,7 @@ class Application
|
||||
public Database $db;
|
||||
public Session $session;
|
||||
public ?DbModel $user;
|
||||
public View $view;
|
||||
|
||||
public function __construct($rootPath, array $config)
|
||||
{
|
||||
@@ -28,6 +29,7 @@ class Application
|
||||
$this->request = new Request();
|
||||
$this->response = new Response();
|
||||
$this->router = new Router($this->request, $this->response);
|
||||
$this->view = new View();
|
||||
|
||||
$this->db = new Database($config['db']);
|
||||
$this->session = new Session();
|
||||
@@ -78,12 +80,12 @@ class Application
|
||||
echo $this->router->resolve();
|
||||
}catch(ForbiddenException $e){
|
||||
$this->response->setStatusCode(403);
|
||||
echo $this->router->renderView('_error', [
|
||||
echo $this->view->renderView('_error', [
|
||||
'exception' => $e
|
||||
]);
|
||||
}catch(NotFoundException $e){
|
||||
$this->response->setStatusCode(404);
|
||||
echo $this->router->renderView('_error', [
|
||||
echo $this->view->renderView('_error', [
|
||||
'exception' => $e
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user