Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
204 views
in Technique[技术] by (71.8m points)

Laravel 4: What is the replacement for Asset::add?

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

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?

question from:https://stackoverflow.com/questions/14205404/laravel-4-what-is-the-replacement-for-assetadd

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

Stylesheet:

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

Javascript:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...