Laravel Escaping All HTML in Blade Template

后端 未结 6 1628
迷失自我
迷失自我 2020-11-30 07:01

I\'m building a small CMS in Laravel and I tried to show the content (which is stored in the DB). It is showing the HTML tags instead of executing them. Its like there is an

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 07:35

    Change your syntax from {{ }} to {!! !!}.

    As The Alpha said in a comment above (not an answer so I thought I'd post), in Laravel 5, the {{ }} (previously non-escaped output syntax) has changed to {!! !!}. Replace {{ }} with {!! !!} and it should work.

提交回复
热议问题