mirror of
https://github.com/flarum/core.git
synced 2025-07-17 14:51:19 +02:00
Add a "return home" link to 404 errors
This commit is contained in:
@@ -85,7 +85,11 @@ class HandleErrors
|
|||||||
// Log the exception (with trace)
|
// Log the exception (with trace)
|
||||||
$this->logger->debug($error);
|
$this->logger->debug($error);
|
||||||
|
|
||||||
$view = $this->view->make('flarum::error')->with('error', $error);
|
if (! $this->view->exists($name = 'flarum::error.'.$status)) {
|
||||||
|
$name = 'flarum::error.default';
|
||||||
|
}
|
||||||
|
|
||||||
|
$view = $this->view->make($name)->with('error', $error);
|
||||||
|
|
||||||
return new HtmlResponse($view->render(), $status);
|
return new HtmlResponse($view->render(), $status);
|
||||||
}
|
}
|
||||||
|
12
framework/core/views/error/404.blade.php
Normal file
12
framework/core/views/error/404.blade.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
@extends('flarum.forum::layouts.basic')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<p>
|
||||||
|
{{ $translator->trans('core.views.error.404_message') }}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="{{ $app->url() }}">
|
||||||
|
{{ $translator->trans('core.views.error.404_return_link', ['{forum}' => $settings->get('forum_title')]) }}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
@endsection
|
@@ -34,6 +34,7 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: {{ $primaryColor }};
|
color: {{ $primaryColor }};
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
Reference in New Issue
Block a user