1

I tried to install Twitter Bootstrap on Symfony2 2.3 following this simple tutorial: http://bootstrap.braincrafted.com/getting-started

All appears successfully installed, in fact checking into the vendor folder, there are the braincrafted, jquery and twitter ones.

Then, how i can call the bootrstrap .css (or .less) files into my .twig ones? Probably i'm mistaking some steps or stupid thing but in that tutorial i don't see a way to make it.

I thought a thing like below but maybe i'm in wrong:

<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />

Thank you

2 Answers 2

3

Don't forget to add lessphp to your composer.json.

then do a composer.phar update

then In the section With Assetic use the lessphp method.

At this moment : php app/console assetic:dump

To finish include the files as Alain Tiemblo said.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you Ybert. That's perfect!! In fact i had already done what Alain Tiemblo wrote but the lost step was just to input the assetic:dump: php app/console assetic:dump. Now it works! Thanks a lot! :)
2

You need to add the bootstrap inclusion between your <head> tags:

<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}">

And at the bottom of your file, just before the </body> tag, include required scripts:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ asset('js/jquery.js') }}"><\/script>')</script>
<script src="{{ asset('js/bootstrap/bootstrap.js') }}"></script>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.