Reputation:
I bought bootstrap template and try to implement it to my symfony project, but it does not works. I included css and js like this:
<link href="{{ asset('/css/bootstrap.min.css') }}" rel="stylesheet">
What i did wrong?
Upvotes: 0
Views: 333
Reputation:
the problem was in XAMPP, swapped to VertigoServ and it works now.
Upvotes: 0
Reputation: 2194
It's important in Symfony to use blocks and one folder assets inside of folder web.
Example:
{% block stylesheets %}
<link href="{{ asset('assets/bootstrap/css/bootstrap.min.css') }}" type="text/css" rel="stylesheet" />
<link href="{{ asset('assets/css/bootstrap.cosmo.min.css') }}" type="text/css" rel="stylesheet" />
<link href="{{ asset('assets/css/styles.css') }}" type="text/css" rel="stylesheet" />
{% endblock %}
Regards
Upvotes: 0
Reputation: 151
Put your bootstrap assets folders (css, js, images...) in your web folder. Next use this code:
<link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet">
in your twig template.
Upvotes: 1
Reputation: 33
Go into your website, locally or not, and press CTRL-i. Here, browse the DOM of your page and look if the stylesheet path is valid or not. This will be the first step to find where the issue is coming from.
Upvotes: 0