How can display space in view blade laravel 5.3?

本秂侑毒 提交于 2020-01-17 04:44:06

问题


My records in db is like this :

I want to display with space

I try like this :

{{ nl2br($text) }}

and

{{ nl2br(e($text)) }}

It does not work

How can I solve it?


回答1:


have you tried using {!! !!} here you can use HTML entity &nbsp




回答2:


you can create a helper like this $output = nl2br(str_replace(" ", "  ", $db_record));

Then your blade file {!! $output !!};



来源:https://stackoverflow.com/questions/43714169/how-can-display-space-in-view-blade-laravel-5-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!