gata basic ul

This commit is contained in:
Cerbu Andrei Mihnea
2023-05-10 03:28:30 +03:00
parent 90f12ab916
commit a739a66ae4
19 changed files with 255 additions and 110 deletions
+4 -2
View File
@@ -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
]);
}