Laravel链接CSS资产的5个问题 [英] Laravel 5 issues with linking css assets
问题描述
am当前正在尝试将laravel 4应用程序移植到laravel 5.我已经将"illuminate/html": "5.*"
添加到了作曲家,还添加了Facade和服务提供商来进行配置.我正在使用以下语法链接到我的CSS文件
am currently trying to port my laravel 4 application to laravel 5 . i have added "illuminate/html": "5.*"
to composer and also the facade and service providers to config. i was using the following syntax to link to my css files
{{ HTML::style('css/bootstrap.min.css') }}
{{ HTML::style('css/style.css') }}
但是在laravel 5中,我的视图输出全部坏掉了,页面显示如下面的屏幕截图.
but in laravel 5 , my views output is all broken , with the page displaying like the below screenshot .
我在这里想念什么? laravel 5中的blade语法有什么变化吗?
what could i be missing here ? is there any changes to the blade syntax in laravel 5 ?
推荐答案
在此此处.
第二条泰勒•奥特威尔(Taylor Otwell)自己回答.在laravel 5中,laravel 4的默认语法{{ code }}
将转义数据输出.如果您想要未转义的html数据,则必须使用新语法
found the answer here on this thread and here .
on the second thread Taylor Otwell gives the answer himself . In laravel 5 , the laravel 4 default syntax {{ code }}
, will escape the data output . if you want unescaped html data, you have to use the new syntax
{!! HTML::style('css/style.css') !!}
如果要还原为以前的语法,可以使用
if you want to revert to previous syntax you can use
Blade::setRawTags('{{', '}}');
这篇关于Laravel链接CSS资产的5个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!