From 6736c4593f4c933562953bd2f15848acb94428e6 Mon Sep 17 00:00:00 2001 From: rotimi Date: Sun, 23 Feb 2025 17:33:57 -0700 Subject: [PATCH] Renamed error-template.php to error-template.html to make it clear that error template files should not contain php code --- config/app-settings-dist.php | 2 +- documentation/MOVIE_CATALOG_APP_WALK_THROUGH.md | 2 +- documentation/QUICKSTART.md | 2 +- public/index-dist.php | 2 +- .../{error-template.php => error-template.html} | 5 ++--- 5 files changed, 6 insertions(+), 7 deletions(-) rename src/layout-templates/{error-template.php => error-template.html} (82%) diff --git a/config/app-settings-dist.php b/config/app-settings-dist.php index 84755b8..f6584b9 100644 --- a/config/app-settings-dist.php +++ b/config/app-settings-dist.php @@ -45,7 +45,7 @@ 'error_template_file'=> SMVC_APP_ROOT_PATH. DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'layout-templates' . DIRECTORY_SEPARATOR - . 'error-template.php', + . 'error-template.html', 'use_mvc_routes' => true, 'mvc_routes_http_methods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], 'auto_prepend_action_to_action_method_names' => false, diff --git a/documentation/MOVIE_CATALOG_APP_WALK_THROUGH.md b/documentation/MOVIE_CATALOG_APP_WALK_THROUGH.md index f370a86..df0f638 100644 --- a/documentation/MOVIE_CATALOG_APP_WALK_THROUGH.md +++ b/documentation/MOVIE_CATALOG_APP_WALK_THROUGH.md @@ -836,7 +836,7 @@ for our app) like so: } ``` -Next we edit our site's error layout template (**`./src/layout-templates/error-template.php`**) which will be used by the framework to display errors like HTTP 404 Not Found, 500 Internal Server Error, etc. We want this template to have the same look and feel as **./src/layout-templates/main-template.php** +Next we edit our site's error layout template (**`./src/layout-templates/error-template.html`**) which will be used by the framework to display errors like HTTP 404 Not Found, 500 Internal Server Error, etc. We want this template to have the same look and feel as **./src/layout-templates/main-template.php** ```php diff --git a/documentation/QUICKSTART.md b/documentation/QUICKSTART.md index 9fa8e3a..ff0f6cd 100644 --- a/documentation/QUICKSTART.md +++ b/documentation/QUICKSTART.md @@ -269,7 +269,7 @@ * **`src/controllers/Hello.php`:** Example Controller class. -* **`src/layout-templates/error-template.php`:** Default template used by this framework to display all your application's error pages like **404 - Not Found**, etc. Tweak it to match your site's look and feel while leaving the three **%s** tokens inside it (they are substituted with error title & description info when this template is rendered at run-time). +* **`src/layout-templates/error-template.html`:** Default template used by this framework to display all your application's error pages like **404 - Not Found**, etc. Tweak it to match your site's look and feel while leaving the three **%s** tokens inside it (they are substituted with error title & description info when this template is rendered at run-time). * **`src/layout-templates/main-template.php`:** Default site template you can use as a starting point for your application's layout. diff --git a/public/index-dist.php b/public/index-dist.php index af8f557..072684e 100644 --- a/public/index-dist.php +++ b/public/index-dist.php @@ -229,7 +229,7 @@ function sMVC_GetCurrentAppEnvironment(): string { // caused the exception to be able to see the full exception. $error_template = file_get_contents( - dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'layout-templates' . DIRECTORY_SEPARATOR . 'error-template.php' + dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'layout-templates' . DIRECTORY_SEPARATOR . 'error-template.html' ); $title = 'Uncaught Exception Occurred
'; diff --git a/src/layout-templates/error-template.php b/src/layout-templates/error-template.html similarity index 82% rename from src/layout-templates/error-template.php rename to src/layout-templates/error-template.html index f4dd155..9d4ff95 100644 --- a/src/layout-templates/error-template.php +++ b/src/layout-templates/error-template.html @@ -1,8 +1,7 @@