Laravel链接CSS资产的5个问题 [英] Laravel 5 issues with linking css assets

查看:76
本文介绍了Laravel链接CSS资产的5个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 ?

推荐答案

在此

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆