Laravel session 将标签转换为 html 实体
Laravel session Convert tags to html entity
我想将此消息值转换为 html 实体:
return redirect('/')->withErrors(['success' => 'register done .<br> Thanks for register.']);
但在我的 blade 中:
@if($errors->first('success'))
$('.top-right').notify({
message: { html: " <b>{{ $errors->first('success') }}</b> " },
type: 'success',
fadeOut: { enabled: true, delay: 7000 }
}).show();
@endif
{{ $errors->first('success') }}
显示这个:
register done .<br> Thanks for register
你应该使用:
{!! $errors->first('success') !!}
而不是
{{ $errors->first('success') }}
我想将此消息值转换为 html 实体:
return redirect('/')->withErrors(['success' => 'register done .<br> Thanks for register.']);
但在我的 blade 中:
@if($errors->first('success'))
$('.top-right').notify({
message: { html: " <b>{{ $errors->first('success') }}</b> " },
type: 'success',
fadeOut: { enabled: true, delay: 7000 }
}).show();
@endif
{{ $errors->first('success') }} 显示这个:
register done .<br> Thanks for register
你应该使用:
{!! $errors->first('success') !!}
而不是
{{ $errors->first('success') }}