webeweb/bootstrap-bundle
Symfony bundle that integrates Bootstrap into your applications, providing bundled assets, Twig helpers, form themes, and UI utilities so you can build responsive, consistent interfaces with less configuration and cleaner templates.
Install the bundle
composer require webeweb/bootstrap-bundle
The package is archived and last tagged in Dec 2023, so expect a pinned version compatible with your Symfony version (the bundle was built for Symfony 4/5-era apps).
Register it
symfony/flex, the bundle is usually auto-registered into config/bundles.php.// config/bundles.php
Webeweb\BootstrapBundle\WebewebBootstrapBundle::class => ['all' => true],
Publish the bundled assets
php bin/console assets:install --symlink public/
This exposes the CSS/JS under public/bundles/webewebbootstrap/... (confirm the exact folder name in the repo's Resources/public directory).
First use case — wire Bootstrap into your base layout in templates/base.html.twig:
<link rel="stylesheet" href="{{ asset('bundles/webewebbootstrap/css/bootstrap.min.css') }}">
...
<script src="{{ asset('bundles/webewebbootstrap/js/bootstrap.bundle.min.js') }}"></script>
Start here: load a navbar + modal in one template to confirm both CSS and the JS bundle (which includes Popper for 4.x/5.x) resolve correctly before rolling it out to other layouts.
Look first at Resources/public/ (what versions ship) and Resources/views/ (whether any Twig macros/blocks are provided) since there is no full docs site — the README and directory tree are your API reference.
Layout inheritance. Centralize asset inclusion in a single base.html.twig and have pages {% extends %} it. This is the whole point of the bundle — one canonical, cache-friendly reference rather than per-page CDN links.
Version selection. The bundle advertises Bootstrap 3.x/4.x/5.x and companion jQuery/Popper. Pin the version you need by referencing the specific file paths under Resources/public. Keep an explicit mapping in config/services.yaml or a Twig variable (e.g. bootstrap_version: 5) so you can swap versions in one place:
# config/services.yaml
parameters:
bootstrap_version: '5'
<script src="{{ asset('bundles/webewebbootstrap/js/bootstrap#' ~ bootstrap_version ~ '.bundle.min.js') }}"></script>
(Adjust path to whatever filenames actually ship.)
Load order matters. For Bootstrap 4 (and 3), include jQuery and Popper before the Bootstrap JS. Bootstrap 5 dropped jQuery — don't include it unless you need it elsewhere. Bootstrap's bundle.min.js already contains Popper, so don't double-load.
Pairing with Webeweb theme bundles. The bundle is designed to sit alongside Webeweb core/theme bundles. In practice: let the theme bundle own custom components/overrides, and let this bundle own the upstream Bootstrap files. Keep your import order as Bootstrap → theme overrides so theme rules win.
Modern asset pipelines. If the project uses Webpack Encore or Symfony AssetMapper, you can bypass this bundle and import "bootstrap" from node_modules instead. Only pull in the bundle when you want zero-Node, Symfony-native assets — that's the trade-off it exists for.
Twig namespace. If the bundle exposes templates, reference them with the bundle namespace (@WebewebBootstrap/...) rather than hard-coded bundles/ paths — the Twig loader resolves this automatically.
composer.json ("webeweb/bootstrap-bundle": "x.y.*"), and treat this as a vendored convenience layer, not something that will track future Symfony major releases. Check it installs cleanly against your PHP/Symfony version before committing.assets:install is required in every environment. A fresh deploy (or a CI build without the public symlink) will 404 the CSS/JS. Add assets:install to your deploy pipeline and use --symlink locally, copy mode in production.version config (framework.assets.version) when you change the shipped Bootstrap version, otherwise browsers keep the old CSS.webewebbootstrap? WebewebBootstrapBundle?) determines the bundles/... URL. Verify by running bin/console assets:install and listing public/bundles/, or via bin/console debug:twig for template namespaces.bundle.min.js build.webeweb_bootstrap: keys work — run bin/console config:dump-reference webeweb_bootstrap (or the bundle's actual alias) to discover what's configurable before writing YAML.bin/console debug:twig --filter=<pattern> shows whether templates are exposed under @WebewebBootstrap; bin/console debug:container <service> helps if a Twig extension is registered.templates/ and assets/ — don't edit the bundle's Resources/public in place, since composer update and assets:install will overwrite it.bootstrap npm package instead — this bundle earns its keep only in Symfony-native legacy stacks that already depend on Webeweb bundles.How can I help you explore Laravel packages today?