From 4297ad6d38c23d40404d627d1f30b852e8f42a93 Mon Sep 17 00:00:00 2001 From: Juan Cristobal <65052633+juancristobalgd1@users.noreply.github.com> Date: Sat, 13 Jan 2024 01:14:50 +0100 Subject: [PATCH] update file --- src/Application.php | 8 ++++---- src/Controller.php | 10 +++------- src/functions.php | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Application.php b/src/Application.php index 16f2584..b16622d 100644 --- a/src/Application.php +++ b/src/Application.php @@ -55,6 +55,8 @@ private function preInit(): void { $this->getContainer(); $this->config = config(); + $providersPath = $this->config->paths->providersPath; + $this->container->registerFromDirectory($providersPath); } /** @@ -63,8 +65,6 @@ private function preInit(): void */ private function init(): void { - $providersPath = $this->config->paths->providersPath; - $this->container->registerFromDirectory($providersPath); $this->openRoutesUser(); } @@ -183,10 +183,10 @@ public function logout(string $path = '/'): void } /** - * Get the event handler intent. + * Get the events handler intent. * @return mixed The event handler intent. */ - public function event() + public function events() { return $this->event; } diff --git a/src/Controller.php b/src/Controller.php index 67cef0d..5e84c72 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -144,13 +144,9 @@ public function getAction(): string * @param string $ext * @return string|null */ - public function renderView( - string $view, - ?array $params = [], - bool $buffer = true, - string $ext = '.php' - ): ?string { - return $this->view::render($view, $params, $buffer, $ext); + public function renderView(string $view, ?array $params = [], string $ext = '.php'): ?string + { + return $this->view::render($view, $params, $ext); } /** diff --git a/src/functions.php b/src/functions.php index 47ee798..db12fe7 100644 --- a/src/functions.php +++ b/src/functions.php @@ -99,10 +99,10 @@ function raxmScripts() * @param string $ext The file extension of the View template (default is '.php'). * @return void */ - function view(string $view, array $params = [], bool $buffer = true, string $ext = '.php') + function view(string $view, array $params = [], string $ext = '.php') { // Render the View template using the provided parameters. - $renderedView = Axm::app()->controller->renderView($view, $params, $buffer, $ext); + $renderedView = Axm::app()->controller->renderView($view, $params, $ext); // Display the rendered View template using the 'show' function. return show($renderedView);