Laravel 4:Asset::add 的替代品是什么? [英] Laravel 4: What is the replacement for Asset::add?

查看:20
本文介绍了Laravel 4:Asset::add 的替代品是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您如何在新的 Laravel 4 中管理资产?看起来 Taylor Otwell 已经用新的东西替换了 Asset::add.

How do you manage assets in the new Laravel 4? It looks like Taylor Otwell has replaced Asset::add with something new.

我想做的是让 Laravel 添加我的 CSS 和 JS 文件.在 Laravel 3 中有几种方法可以做到这一点,但现在它们似乎已经消失了.一个是Asset::add,另一个是HTML.这些的替代品是什么?

What I am trying to do is have Laravel add my CSS and JS files. There were several ways to do this in Laravel 3, but they seem to be gone now. One was Asset::add and the other was HTML. What are the replacements for these?

推荐答案

在 Laravel 4 中你可以使用 HTML 类,它默认包含在 Laravel 框架包中:

In Laravel 4 you can use the HTML class, it's default included in the Laravel Framework package:

样式表:

{{ HTML::style('css/style.css') }}

Javascript:

Javascript:

{{ HTML::script('js/default.js') }}

这篇关于Laravel 4:Asset::add 的替代品是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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