diff options
author | Malf Furious <m@lfurio.us> | 2018-10-27 01:22:15 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-10-27 01:22:15 -0400 |
commit | 07c3bb3169bbc41ab9dc8aca312cb4f36581ccd4 (patch) | |
tree | c7a167a0d0b1fec6fb175c6b0705e019bf52475e | |
parent | b9783160efe6ab1d6084113fa5c0fa982404be53 (diff) | |
download | scrott-07c3bb3169bbc41ab9dc8aca312cb4f36581ccd4.tar.gz scrott-07c3bb3169bbc41ab9dc8aca312cb4f36581ccd4.zip |
Add 404 Page not found view
Previously, when the app was asked for non-existant paths, no content
was returned and a blank page was presented to the user. Now a canned
message stating that the requested page does not exist is shown, along
with a helpful link back to the Dashboard page.
Signed-off-by: Malf Furious <m@lfurio.us>
-rw-r--r-- | app/index.php | 6 | ||||
-rw-r--r-- | app/view/404.php | 41 |
2 files changed, 47 insertions, 0 deletions
diff --git a/app/index.php b/app/index.php index 44c2de9..21f3036 100644 --- a/app/index.php +++ b/app/index.php @@ -115,6 +115,12 @@ function main(array $argv) : void break; } } + + /* page not found */ + else + { + require "view/404.php"; + } } } diff --git a/app/view/404.php b/app/view/404.php new file mode 100644 index 0000000..95f4835 --- /dev/null +++ b/app/view/404.php @@ -0,0 +1,41 @@ +<?php + +/* + * SCROTT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * For more information, please refer to UNLICENSE + */ + +require_once "view/stdpage.php"; + +?> + +<!DOCTYPE html> + +<html lang="en"> + <head> + <?=stdpage\head( "Page not found" )?> + </head> + + <body> + <?=stdpage\top()?> + + <div class="container"> + <div class="jumbotron text-center"> + <h1>Page not found</h1> + + <a href="<?=ar()?>/" class="btn btn-primary btn-lg"> + <span class="glyphicon glyphicon-pencil"></span> Go to Scrott Dashboard + </a> + </div> + </div> + + <?=stdpage\foot()?> + </body> +</html> |