Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel 5 Library for load CSS, JavaScript

Tags:

php

laravel

I want to include CSS and Javascript with the help of Laravel 5 helper. But I don't know which is there.

href="{{ url() }}/assets/css/bootstrap.css" rel="stylesheet"

I need to load with the helper of laravel. Not to traditional.

Please any suggestion tell me.

like image 872
Arjun Avatar asked Nov 09 '22 10:11

Arjun


1 Answers

In Laravel you can use the provided HTML class for including the CSS and JS in a project

Stylesheet:

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

Javascript:

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

NOTE:

You can also use URL class

JS

{{ URL::asset('js/your_js_file.js'); }}

STYLE

{{ URL::asset('css/style.css'); }}

EDIT:

If you are using LARAVEL 5 find the solution here http://laravel.io/forum/09-20-2014-html-form-class-not-found-in-laravel-5

like image 181
Abhinav Avatar answered Nov 14 '22 22:11

Abhinav