1

For example, if I want to use Twitter bootstrap 3 in a Symfony 2 project without using a bundle (and of course, without using a CDN). What is the best way to do that ?

There is a better solution than using an output attribute of stylesheet tag in Twig ?

1 Answer 1

3

For my project, I decided to use bower frontend package manager. I can specify required libs(bower.json):

"dependencies": {
    "bootstrap": "~3.3.4",
    "font-awesome": "~4.3.0",
    "jquery" : "~2.1",
    "markup" : "https://github.com/adammark/Markup.js.git",
    "js.class" : "~2.5",
    "bootstrap-select" : "~1.6"
}

And directory to download(.bowerrc):

{
  "directory" : "web/components"
}

And $ bower install will download your dependencies to specified folder. In template files I link such resources directly:

<link rel="stylesheet" href="{{ asset('components/bootstrap/dist/css/bootstrap.min.css') }}" media="screen">
Sign up to request clarification or add additional context in comments.

1 Comment

Perfect ! Thanks a lot.

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.