0
votes

I have problem with fonts, when I use bootstrap in Symfony. I used Bootstrap every time, but it start with Symfony for me. When I included Bootstrap files (css, js, fonts) I see errors: "NetworkError: 404 Not Found - http://127.0.0.1:8000/Resources/public/fonts/glyphicons-halflings-regular.woff" glyphic...ar.woff "NetworkError: 404 Not Found - http://127.0.0.1:8000/Resources/public/fonts/glyphicons-halflings-regular.ttf"

I included it in MyBundle/Resources/public/css (and fonts/ and js/)

Paths to glyphicons are correctly, because it's url: ../glyphicons-halflings...

Could You help me please? It's very important for me!

Regards

1
What about showing us some code ? Like your twig template for instance, where you call the files. I'm guessing that you don't fully understand the asset routing in Symfony... symfony.com/doc/current/best_practices/web-assets.html - tchap
Ok, but I would like stored it in my bundle, not in web directory.. And all works correctly, but not works only fonts.. I get below errors.. why? - Marcin.ka
It *will be stored in your bundle, your web directory will only be populated when your run assets:install. And you have problems with fonts because you put some absolute paths somewhere. You really should read a tutorial on assetic / assets before doing this - tchap
Yes, You are right! I saw that filters not works when I use path e.g: @MainBundle/Resources/public/css/bootstrap.min.css I should use real path, but what will real path for @MainBundle/Resources/public/css/bootstrap.min.css? Could You help me again please? - Marcin.ka
So .. use a relative path in your css and you'll be good : ../fonts/blabla.ttf - tchap

1 Answers

0
votes

As stated in the comments below the OP's question, use a relative css path :

../fonts/glyphicons-halflings-regular.woff