Created custom 404 error handling
This commit is contained in:
parent
f2ca6af5bc
commit
85e434dd83
@ -1,12 +1,15 @@
|
||||
<?php
|
||||
|
||||
// Home view(s)
|
||||
require 'routes/index.php';
|
||||
require 'routes/about.php';
|
||||
require 'routes/contact.php';
|
||||
require 'routes/home.php';
|
||||
require 'routes/music.php';
|
||||
require 'routes/shows.php';
|
||||
// Main view routes
|
||||
require 'routes/pages/index.php';
|
||||
require 'routes/pages/about.php';
|
||||
require 'routes/pages/contact.php';
|
||||
require 'routes/pages/home.php';
|
||||
require 'routes/pages/music.php';
|
||||
require 'routes/pages/shows.php';
|
||||
|
||||
// API routes
|
||||
require 'routes/apiv1/music.php';
|
||||
|
||||
// Errors
|
||||
require 'routes/errors/404.php';
|
||||
|
5
app/routes/errors/404.php
Normal file
5
app/routes/errors/404.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$app->notFound(function() use ($app) {
|
||||
$app->render('errors/404.twig');
|
||||
});
|
13
app/views/errors/404.twig
Normal file
13
app/views/errors/404.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends 'templates/default.twig' %}
|
||||
|
||||
{% block title %}404 Error{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Error information section -->
|
||||
<section id="error-section" class="row">
|
||||
<div class="col-xs-12 card hover-box shadow-1">
|
||||
<h4>404 Error</h4>
|
||||
<p>The URL you were looking for doesn't exist. Perhaps you'd like to start over at the <a href="{{ urlfor('home') }}">home page</a>?</p>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user