【发布时间】:2016-01-13 16:09:08
【问题描述】:
我有一个表单请求类来验证我的数据,我正在使用 messages() 方法返回自定义验证错误消息,如下所示:
public function messages()
{
return [
'name.valid_name' => 'The name is incorrect, please see the <a href="'.route('naming_conventions').'">Naming Conventions</a> page for instructions on naming.'
];
}
如您所见,我想在错误消息中输出一个超链接以帮助用户。当所有的 html 标签都被转换为实体时,输出错误消息时,实际输出的是:
The name is incorrect, please see the <a href="http://local.website.com/naming-conventions">Naming Conventions</a> page for instructions on naming.
如何在错误消息中输出 HTML?
【问题讨论】:
标签: php laravel laravel-5 laravel-5.1