Skip to content

Commit

Permalink
Renamed error-template.php to error-template.html to make it clear th…
Browse files Browse the repository at this point in the history
…at error template files should not contain php code
  • Loading branch information
rotimi committed Feb 24, 2025
1 parent 91c2046 commit 6736c45
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/app-settings-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion documentation/MOVIE_CATALOG_APP_WALK_THROUGH.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!doctype html>
Expand Down
2 changes: 1 addition & 1 deletion documentation/QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion public/index-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<br>';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!doctype html>
<!--
Please DO NOT add php code to this file, just pure html, css & js
since it will be used to display error messages and should always
display correctly.
Please DO NOT delete this file, you can make a copy of it and set that copy as your error template file in app-settings.php.
If your app bootstrapping fails, this file will be used as final fallback error template file
-->
<html lang="en">
<head>
Expand Down

0 comments on commit 6736c45

Please sign in to comment.