user8389078
user8389078

Reputation:

Bootstrap template in symfony

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

Answers (4)

user8389078
user8389078

Reputation:

the problem was in XAMPP, swapped to VertigoServ and it works now.

Upvotes: 0

juanitourquiza
juanitourquiza

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

kouakou alexis
kouakou alexis

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

Daniel Medina
Daniel Medina

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

Related Questions