seegno/bootstrap-bundle
Seegno Bootstrap Bundle integrates Bootstrap with Symfony applications, providing form themes, Twig helpers, and templates for rendering responsive, Bootstrap-styled forms and UI components with consistent markup.
Read this first: this bundle was last tagged in June 2016 and targets Symfony 2.x. The package name in Composer is seegno/bootstrap-bundle, but the bundle class is Seegno\BootstrapBundle\SeegnoBootstrapBundle — verify both against composer.json and SeegnoBootstrapBundle.php in the repo before doing anything else. With 2 stars and 0 dependents, assume there is no documentation beyond the source and no upstream support.
Minimum viable install:
composer require seegno/bootstrap-bundle
// app/AppKernel.php
$bundles = [
// ...
new Seegno\BootstrapBundle\SeegnoBootstrapBundle(),
];
Then check DependencyInjection/Configuration.php for the actual root config node (likely seegno_bootstrap) and drop an empty block in app/config/config.yml so the extension loads deterministically:
seegno_bootstrap: ~
Where to look first, in this order:
Resources/config/services.xml (or .yml) — tells you exactly what Twig extensions, form types, and listeners are registered, and under what service IDs.Twig/ — the extension classes are the real API surface; every public method becomes a Twig function/filter with the name defined in getFunctions()/getFilters().Resources/views/ — the template names and block structure you will call or override.DependencyInjection/Configuration.php — the only source of truth for config keys; there is no README worth trusting.First use case to validate the install: render a Bootstrap alert from a Symfony flash message in your base layout, or apply the bundle's form theme to a single form. If either renders with correct Bootstrap 3 classes, the bundle is wired up. If the Twig function is undefined, run php app/console debug:twig (Symfony 2.6+) or twig:debug on 2.3–2.5 and confirm the extension appears in the list — that's your fastest smoke test.
Twig helper usage. The bundle's value is almost entirely Twig-side sugar — alerts, labels, badges, panels, icons. Rather than memorizing signatures, dump them once:
php app/console debug:twig --filter=alert # Symfony >= 2.6
Then wrap the calls in your own macro layer so the bundle never leaks into every template:
{# app/Resources/views/_ui.html.twig #}
{% macro dangerAlert(msg) %}
{{ bootstrap_alert(msg, 'danger') }}
{% endmacro %}
This costs nothing today and makes removing the dependency a one-file change later.
Form theming. This is where most day-to-day value lives. Prefer applying the theme per-form rather than globally while you evaluate it:
{% form_theme form 'SeegnoBootstrapBundle:Form:fields.html.twig' %}
Important: Symfony's own Twig Bridge already ships bootstrap_3_layout.html.twig, which is maintained. Use the bundle's theme only where it does something the bridge doesn't, and benchmark both. If you apply it globally via twig.form_themes in config.yml, you inherit its block names for every form in the app — a hard thing to unwind.
Flash messages in the layout. The classic integration is a loop in base.html.twig mapping app.session.flashes('success') to the bundle's alert helper. Do the mapping in an included partial, not inline in the layout, so you can swap the renderer without touching the layout when the bundle is dropped.
Asset handling. The bundle almost certainly does not ship Bootstrap CSS/JS. Keep Bootstrap in your own pipeline (CDN, Assetic, or web/), pinned to the major version the bundle's markup targets — Bootstrap 3 given the 2016 release date. Mixing Bootstrap 4 markup with these helpers produces visually broken but non-erroring output, which is the most expensive failure mode here.
Version pinning and vendoring. Require an exact version ("seegno/bootstrap-bundle": "1.0.x-dev" or the specific tag) so a repo change can't shift your build. For anything production-bound, fork to a private VCS or repositories path entry and treat it as owned code:
"repositories": [{"type": "vcs", "url": "[email protected]:yourorg/SeegnoBootstrapBundle.git"}]
Recommended long-term pattern: extract. The bundle's helpers are small and its surface is narrow. Copy the two or three Twig functions and the form theme blocks you actually use into an AppBundle\Twig extension and app/Resources/views/Form/, then delete the dependency. On a package this size the extraction is usually a half-day and eliminates the Symfony upgrade blocker entirely.
%kernel.root_dir%-style parameters, and Twig_Extension base classes will not survive Symfony 3/4/5. If you're on anything newer than 2.8, this bundle is a non-starter — vendor the templates instead.Twig_Extension in favour of AbstractExtension; PHP 7.2+ will emit deprecation notices from the 2016-era code. Suppress or patch, but don't expect upstream fixes.composer.lock safety net for transitive deps. A 2016 bundle's constraints on symfony/* and twig/twig are wide open. Lock the whole project and run composer why-not symfony/framework-bundle 3.0 when upgrades fail; this bundle will be the answer more than once.debug:twig on the theme resource list, not by reading the template.AppKernel.php, or the extension's config node was never declared. Confirm with php app/console container:debug | grep -i bootstrap.seegno_bootstrap — open Configuration.php. An unrecognized root node throws InvalidConfigurationException with the valid keys listed, which is a fine way to discover them.getParent() override trick for replacing templates works on 2.8 but is removed later. Override by listing your own template path ahead of the bundle's, or reference your templates explicitly.pull-right became float-right, Glyphicons disappeared. Any helper emitting icon markup is dead weight on Bootstrap 4+; replace with inline SVG or an icon font.services.yml (same ID, your class), or decorate it. Both are more stable than editing the bundle in vendor/, which will be clobbered by composer install.How can I help you explore Laravel packages today?