From 2fea12ea03dce6a07000fe02a7b3d73ef9636d9a Mon Sep 17 00:00:00 2001 From: Trehinos Date: Thu, 9 Mar 2023 10:17:12 +0100 Subject: [PATCH] Some updates --- app/res/config/config.yml | 2 +- thor/Framework/Actions/Main.php | 3 ++- thor/Framework/Factories/TwigFunctionFactory.php | 1 + thor/Http/Client/CurlClient.php | 11 ++++++++--- thor/Http/Request/UploadedFile.php | 3 +++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/res/config/config.yml b/app/res/config/config.yml index df57f1e..0480e51 100644 --- a/app/res/config/config.yml +++ b/app/res/config/config.yml @@ -1,7 +1,7 @@ app_vendor: Trehinos app_name: Thor app_version: 1.0.0 -app_version_name: Thor v1 +app_version_name: 'Thor v1' env: DEV lang: fr timezone: Europe/Paris diff --git a/thor/Framework/Actions/Main.php b/thor/Framework/Actions/Main.php index fb4da56..f62ba99 100644 --- a/thor/Framework/Actions/Main.php +++ b/thor/Framework/Actions/Main.php @@ -40,7 +40,8 @@ public function index(): Response #[Route('index-page', '/index', HttpMethod::GET)] public function indexPage(): Response { - return $this->twigResponse('thor/pages/index.html.twig'); + $this->addMessage("Ceci est un message de test", "Message TEST", "default", "Thor V1"); + return $this->twigResponse('thor/pages/index.html.twig', retrieveMessages: true); } /** diff --git a/thor/Framework/Factories/TwigFunctionFactory.php b/thor/Framework/Factories/TwigFunctionFactory.php index 6fb5ad2..1b1439c 100644 --- a/thor/Framework/Factories/TwigFunctionFactory.php +++ b/thor/Framework/Factories/TwigFunctionFactory.php @@ -46,6 +46,7 @@ function (array|string $message) { 'warning' => ['exclamation-triangle', 'text-dark', '', 'text-dark bg-warning'], 'error', 'danger' => ['exclamation-triangle', 'text-danger', 'bg-danger text-light', ''], 'success', 'ok' => ['check', 'text-success', 'bg-success text-light', ''], + 'default' => ['comment', 'text-dark', 'text-dark', 'bg-light text-dark'], }; return <<<ยง