mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
Move view logic into middleware
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
@section('content')
|
||||
<p>
|
||||
{{ $translator->trans('core.views.error.404_message') }}
|
||||
{{ $message }}
|
||||
</p>
|
||||
<p>
|
||||
<a href="{{ $app->url() }}">
|
||||
|
@@ -2,21 +2,6 @@
|
||||
|
||||
@section('content')
|
||||
<p>
|
||||
{{-- TODO: Change below to @php when Laravel is upgraded --}}
|
||||
<?php
|
||||
$getTranslationIfExists = function ($code) use ($translator, $settings) {
|
||||
$key = 'core.views.error.'.$code.'_message';
|
||||
$translation = $translator->trans($key, ['{forum}' => $settings->get('forum_title')]);
|
||||
|
||||
return $translation === $key ? false : $translation;
|
||||
};
|
||||
|
||||
if (! $translation = $getTranslationIfExists($error->getCode())) {
|
||||
if (! $translation = $getTranslationIfExists(500)) {
|
||||
$translation = 'An error occurred while trying to load this page.';
|
||||
}
|
||||
}
|
||||
?>
|
||||
{{ $translation }}
|
||||
{{ $message }}
|
||||
</p>
|
||||
@endsection
|
||||
|
Reference in New Issue
Block a user