A
A
Alexey Cherepanov2015-12-10 06:22:01
Laravel
Alexey Cherepanov, 2015-12-10 06:22:01

How to include css and js in Blade, Laravel 5.1.23?

How to include css and js in Blade template? Where should css and js be by default? Where do constructions like {{ URL::asset('css/css.css'); }}? This construction doesn't work {{ HTML::style('css/css.css'); }}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cherepanov, 2015-12-10
@Udjine

{{ URL::asset('css/css.css'); }} leads to /public/css, {{ URL::asset('js/main.js'); }} leads to /public/js, in fact, css and js should be added there, respectively. Thank you all, it turned out to be quite simple.

D
D', 2015-12-10
@Denormalization

{{ asset('путь') }}
Where 'path' is the path from the site root. The asset
function itself returns the site url. So asset('js/main.js') will return: The JS folder must be in the public folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question