From d1a68c763bdfa6ebbd71e2eee4ff870fed88be5f Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 4 Aug 2021 00:40:54 +0200 Subject: Move error page logic into the Application class Move the logic for generating the error pages into the Application class to remove this ugly "require" call in the error403 and error404 methods. --- 404.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to '404.php') diff --git a/404.php b/404.php index 25cc683..72ff5c0 100644 --- a/404.php +++ b/404.php @@ -2,19 +2,9 @@ #=============================================================================== # INCLUDE: Initialization #=============================================================================== -require_once 'core/application.php'; +require 'core/application.php'; #=============================================================================== -# Send HTTP status code +# Show "404 Not Found" error page #=============================================================================== -http_response_code(404); - -#=============================================================================== -# Build document -#=============================================================================== -$MainTemplate = Template\Factory::build('main'); -$MainTemplate->set('NAME', '404 Not Found'); -$MainTemplate->set('HEAD', ['NAME' => $MainTemplate->get('NAME')]); -$MainTemplate->set('HTML', Template\Factory::build('404')); - -echo $MainTemplate; +Application::error404(); -- cgit v1.2.3