What is the correct way to add bootstrap to a symfony app?

后端 未结 6 599
灰色年华
灰色年华 2021-02-13 13:48

I\'m using symfony framework 3 to develop a web application. I need to add boostrap\'s functionality to my application. I installed bootstrap using the below command. (I\'m usin

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-13 14:37

    The suggested approach changed since Symfony version 4: Webpack Encore is used with npm / yarn for bundling the CSS and JavaScript resources, where the Bootstrap framework can be included.

    Start by installing Encore and follow with the Bootstrap-specific documentation. In summary, the following commands have to be performed:

    composer require symfony/webpack-encore-bundle
    yarn install
    yarn add bootstrap --dev
    
    # after making the required changes to webpack.config.js, app.js, run Encore
    yarn encore dev --watch
    

提交回复
热议问题