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);