简体   繁体   中英

how to display html values from a database in a blade view in Laravel?

I have a data in my database which contains HTML syntax. I want to display it in a blade view but it comes along with the html tags. How can i display the view? 在此处输入图像描述

how do i display this in laravel without the tags but using the html format?

You need to unescape the element in blade.

Instead of:

{{ $element }}

Use:

{!! $element !!}

As Lagbox notes in the comments, it is important that if you use unescaped data, that you have purified it in advance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM