【发布时间】:2017-03-18 18:27:19
【问题描述】:
我在views/errors/404.blade.php 中有以下文件:
Error Here!
当我输入错误的 URL 时,它会按预期工作(我只看到“此处出错!”文本)。
但是,如果我更新文件以包含以下内容:
@extends('layouts.page')
@section('title', @trans('general.error'))
@section('content')
Error here!
@endsection
我确实收到了“此处出错”消息,但我也看到了“哎呀,好像出了点问题”。消息和 HTML 都搞砸了。指定的布局 (layouts/page.blade.php) 存在并且是我用于所有其他视图的布局。
知道为什么会这样吗?
提前致谢!
【问题讨论】:
-
尝试将
@trans更改为trans.. 也许 -
嗨@lagbox!超级奇怪,无论有没有@,翻译都有效,但是即使我删除它,问题仍然存在。
标签: laravel laravel-5 laravel-5.3 laravel-views