2017-01-13 8 views
2

어떻게 메시지에서 줄 바꿈을 수행합니까? 메시지의 Laravel 줄 바꿈

내가

$request->session()->flash('message', "first line \r\n second line"); 
$request->session()->flash('message', "first line <br> second line"); 

다음 시도하지만 작동하지 않았다, 나는이 방법을 수행합니까?

+0

https://laracasts.com/discuss/channels/laravel/how-to-get-html-in-response-session -flash-or-redirect-with-messages –

답변

0

다음과 같이 이스케이프 처리되지 않은 데이터를 표시합니다.

{!! $message !!} 
2

당신은 시도 할 수 있습니다 :

{!! 'first line <br> second line' !!} 

출력

first line 
second line 

그리고

{!! nl2br(e('first line <br> second line')) !!} 

출력

first line <br> second line