PHPackages                             seegno/bootstrap-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. seegno/bootstrap-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

seegno/bootstrap-bundle
=======================

Bootstrap utilities for Symfony2

2.0.0(10y ago)23.9k2MITHTML

Since Sep 4Pushed 10y ago3 watchersCompare

[ Source](https://github.com/seegno/SeegnoBootstrapBundle)[ Packagist](https://packagist.org/packages/seegno/bootstrap-bundle)[ RSS](/packages/seegno-bootstrap-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (3)Versions (12)Used By (0)

SeegnoBootstrapBundle
=====================

[](#seegnobootstrapbundle)

[Bootstrap](http://getbootstrap.com) utilities for Symfony3

---

1. Installation
---------------

[](#1-installation)

1.1. Add the bundle to your `composer.json`:

```
$ php composer.phar require seegno/bootstrap-bundle dev-master

```

1.2. Register the bundle on `app/AppKernel.php`:

```
public function registerBundles()
{
    return array(
        // ...
        new Seegno\BootstrapBundle\SeegnoBootstrapBundle()
    );
}

```

1.3. (Optional) Symlink `twbs/bootstrap` and `twbs/bootstrap/fonts`. From your `web` folder:

```
$ ln -s ../vendor/twbs/bootstrap bootstrap
$ ln -s ../vendor/twbs/bootstrap/fonts fonts

```

2. Usage
--------

[](#2-usage)

### Templates

[](#templates)

If you want to extend one of the *SeegnoBootstrapBundle* templates, you'll need to add the bundle to *Assetic Configuration*:

```
# app/config.yml
assetic:
    bundles:
        - SeegnoBootstrapBundle

```

### Forms

[](#forms)

To use the *SeegnoBootstrapBundle* form theme just import it *in place*:

```
{# some_view.html.twig #}
{% form_theme form 'SeegnoBootstrapBundle:Form:layout.html.twig' %}

```

Or, add it globally to *Twig Configuration*:

```
# app/config.yml
twig:
    form:
        resources: ['SeegnoBootstrapBundle:Form:layout.html.twig']

```

### Alerts

[](#alerts)

There are two *twig functions* to help you handle the flash messages:

###### All at once

[](#all-at-once)

Render all the `FlashBag` you can include the following *twig function* anywhere on your *view*:

```
{# some_view.html.twig #}
{{ seegno_bootstrap_alerts() }}

```

By default will render the *keys* "success", "info", "warning" and "danger" flashes. You can change this on the *SeegnoBootstrap Configuration*:

```
# app/config.yml
seegno_bootstrap:
    alerts: ["success", "info", "warning", "danger"]

```

Or, if you want to catch any *flash*, turn the *strict* option off:

```
{# some_view.html.twig #}
{{ seegno_bootstrap_alerts(false) }}

```

###### Just what you want

[](#just-what-you-want)

Render a *flash* individually (this will lookup for the given key on the *FlashBag*):

```
{# some_view.html.twig #}
{{ seegno_bootstrap_alert('success') }}

```

You can also use this *twig function* adding a message (without adding it to the *FlashBag*):

```
{# some_view.html.twig #}
{{ seegno_bootstrap_alert('success', 'Your message here') }}

```

### Navs

[](#navs)

Navigation takes advantage of [KnpMenuBundle](https://github.com/KnpLabs/KnpMenuBundle). Use the *navigation layout* included:

```
# app/config.yml
knp_menu:
    twig:
        template: SeegnoBootstrapBundle:Nav:layout.html.twig

```

Or, use it on the *twig function*:

```
{{ knp_menu_render('main', { 'template': 'SeegnoBootstrapBundle:Nav:layout.html.twig' }) }}

```

Furthermore, to make the menus easier to define we've included a custom `MenuProvider` to define the menus using `yaml`. You can define a menu as showed bellow:

```
# app/config.yml
seegno_bootstrap:
    navs:
        menus:
            main:
                childrenAttributes: { class: 'nav nav-pills' }
                items:
                    homepage: { label: 'Pages', route: 'homepage' }
                    about:    { label: 'About', route: 'about' }
                    blog:     { label: 'Blog', route: 'blog', extras: { 'routes': [{ pattern: '/^blog/' }] } }

```

The `MenuProvider` provides some menu item extras:

- **submenu**: The key of another menu to render it as menu item children.
- **roles**: An array of roles setted as an extra parameter that check if the users has access to certain menu item.

The `twig template` included also have some extras:

- **include**: The template location setted as an extra parameter, i.e., `SeegnoBootstrapBundle:Example:menuitem.html.twig`
- **render**: The controller setted as an extra parameter, i.e., `SeegnoBootstrapBundle:Example:menuitem`

### Pagination

[](#pagination)

Pagination takes advantage of [KnpPaginatorBundle](https://github.com/KnpLabs/KnpPaginatorBundle) and we suggest you to use it in case you need to paginate something.

We've included two different views: a *default pagination* and a *pager*.

Added it to *KnpPaginator Configuration*:

```
# app/config.yml
knp_paginator:
    template:
        pagination: SeegnoBootstrapBundle:Pagination:layout.html.twig

```

Or, just use it with the *twig function*:

```
{{ knp_pagination_render(pagination, 'SeegnoBootstrapBundle:Pagination:pager.html.twig') }}

```

Check the examples section for more.

3. Examples
-----------

[](#3-examples)

The bundle includes some examples. Check the code on `Controller/ExampleController.php` and relative *views*.

If you want to see them on your browser, add the following route to your routing file:

```
# app/routing_dev.yml
seegno_bootstrap_example:
    resource: "@SeegnoBootstrapBundle/Resources/config/routing/example.yml"
    prefix: /seegno/bootstrap

```

And, the `seegno_bootstrap` menu:

```
# app/config_dev.yml
seegno_bootstrap:
    seegno_bootstrap_example:
        childrenAttributes: { class: 'nav nav-pills nav-stacked'}
        items:
            alerts:     { label: 'Alerts', route: 'seegno_bootstrap_alerts' }
            forms:      { label: 'Forms', route: 'seegno_bootstrap_forms' }
            navs:       { label: 'Navs', route: 'seegno_bootstrap_navs' }
            pagination: { label: 'Pagination', route: 'seegno_bootstrap_pagination' }
            something:  { extras: { include: 'SeegnoBootstrapBundle:Example:menuitem.html.twig' } }

```

---

4. Style Guide
--------------

[](#4-style-guide)

It's always helfult to have a styleguide. In order to do it, add the following entry to your `routing_dev.yml` file:

```
# app/routing_dev.yml
seegno_bootstrap_styleguide:
    resource: "@SeegnoBootstrapBundle/Resources/config/routing/styleguide.yml"
    prefix: /seegno/bootstrap

```

Next, you'll need to override the Twig template so you can view the style guide with your stylesheets. Create the file `app/Resources/SeegnoBootstrapBundle/views/StyleGuide/index.html.twig` with the following content:

```
{% extends 'SeegnoBootstrapBundle:StyleGuide:base.html.twig' %}

{% block stylesheets %}
    {% stylesheets filter="cssrewrite,?yui_css"
        'bundles/acmeproject/less/main.less'
    %}

    {% endstylesheets %}
{% endblock stylesheets %}

```

And now, you can see how the Bootstrap components will look on your app by accessing `/seegno/bootstrap/styleguide` in dev mode.

5. Advanced
-----------

[](#5-advanced)

To do.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Recently: every ~222 days

Total

11

Last Release

3663d ago

Major Versions

1.1.x-dev → 2.0.02016-06-21

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/73298?v=4)[Rui Silva](/maintainers/ruipenso)[@ruipenso](https://github.com/ruipenso)

---

Top Contributors

[![ruipenso](https://avatars.githubusercontent.com/u/73298?v=4)](https://github.com/ruipenso "ruipenso (26 commits)")[![joaonice](https://avatars.githubusercontent.com/u/1272480?v=4)](https://github.com/joaonice "joaonice (2 commits)")[![nunorafaelrocha](https://avatars.githubusercontent.com/u/1175149?v=4)](https://github.com/nunorafaelrocha "nunorafaelrocha (2 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![ruimarinho](https://avatars.githubusercontent.com/u/288709?v=4)](https://github.com/ruimarinho "ruimarinho (1 commits)")

---

Tags

csspaginationSymfony2templatesbootstrapalertsFormsnavigationstyleguidemenusflashesnavs

### Embed Badge

![Health badge](/badges/seegno-bootstrap-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/seegno-bootstrap-bundle/health.svg)](https://phpackages.com/packages/seegno-bootstrap-bundle)
```

###  Alternatives

[infyomlabs/adminlte-templates

AdminLTE templates for InfyOm Laravel Generator

2661.6M7](/packages/infyomlabs-adminlte-templates)[contributte/forms-bootstrap

Nette extension for Bootstrap forms

221.1M4](/packages/contributte-forms-bootstrap)[cornford/bootstrapper

An easy way to intergrate Twitter Bootstrap with Laravel.

232.7k](/packages/cornford-bootstrapper)[nepada/form-renderer

Latte template based form renderer for Nette forms with full support for Bootstrap 3, 4 &amp; 5.

11253.5k](/packages/nepada-form-renderer)[metalogico/laravel-formello

A Laravel package for generating Bootstrap 5 and Tailwind CSS 4 forms based on models

1003.2k](/packages/metalogico-laravel-formello)[raoul2000/yii2-bootswatch-asset

Use Bootswatch theme in your Yii application with minimum effort

2145.5k4](/packages/raoul2000-yii2-bootswatch-asset)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
