PHPackages                             florianbelhomme/flob-foundation-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. florianbelhomme/flob-foundation-bundle

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

florianbelhomme/flob-foundation-bundle
======================================

Integrates the features of the responsive framework Foundation, from Zurb, into Symfony2 by providing templates, Twig extensions, services and commands.

3.0.2(9y ago)4823.9k10[1 issues](https://github.com/florianbelhomme/FlobFoundationBundle/issues)1MITPHPPHP &gt;=5.5.9

Since Jan 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/florianbelhomme/FlobFoundationBundle)[ Packagist](https://packagist.org/packages/florianbelhomme/flob-foundation-bundle)[ RSS](/packages/florianbelhomme-flob-foundation-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (11)Versions (14)Used By (1)

[Flob Foundation Bundle](https://github.com/florianbelhomme/FlobFoundationBundle)
=================================================================================

[](#flob-foundation-bundle)

[![Total Downloads](https://camo.githubusercontent.com/782d5cdef9701f7a79ccecda54311193876810f731388eedc16238d81b26b568/68747470733a2f2f706f7365722e707567782e6f72672f666c6f7269616e62656c686f6d6d652f666c6f622d666f756e646174696f6e2d62756e646c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/florianbelhomme/flob-foundation-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/e04eb8bee062c42bc36c321bdf023dfee7af775066ade9cfbae57a00d27f4851/68747470733a2f2f706f7365722e707567782e6f72672f666c6f7269616e62656c686f6d6d652f666c6f622d666f756e646174696f6e2d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/florianbelhomme/flob-foundation-bundle)[![Build Status](https://camo.githubusercontent.com/7e20387857229988fdfee46859d3142004ea599b56f02c27d169154bf53d27b2/68747470733a2f2f7472617669732d63692e6f72672f666c6f7269616e62656c686f6d6d652f466c6f62466f756e646174696f6e42756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/florianbelhomme/FlobFoundationBundle)[![SensioLabsInsight](https://camo.githubusercontent.com/cd2503c630d6bb388c181cbbe7c4c83522f9a4319741fbe246c169a853582551/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34666665343339622d356130632d346361612d393134652d3030356432313539316333642f6d696e692e706e67)](https://insight.sensiolabs.com/projects/4ffe439b-5a0c-4caa-914e-005d21591c3d)[![License](https://camo.githubusercontent.com/8dab4070e16e3ae0c77fa9eab0f66dd11050640434cd658121f11fd5f93adc79/68747470733a2f2f706f7365722e707567782e6f72672f666c6f7269616e62656c686f6d6d652f666c6f622d666f756e646174696f6e2d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/florianbelhomme/flob-foundation-bundle)

About
-----

[](#about)

**DISCONTINUED**

This bundle integrates the features of the responsive framework Foundation, from ZURB (thanks guys), into Symfony by providing templates, Twig extensions, services and commands. You can quickly setup a responsive theme for an interface for your project. It will have the "look'n'feel", the responsiveness and the simplicity of Foundation.

**BE AWARE: THIS BUNDLE WILL NOT ADD THE FOUNDATION FRAMEWORK BUT RATHER FEATURES FOR SYMFONY TO WORK WITH IT**

Demo available [here](http://florianbelhomme.com/flobfoundationdemobundle/).

Requirements
------------

[](#requirements)

- [Symfony 2.7+](http://symfony.com).
- [jQuery 2+](http://jquery.com/) a JavaScript library.
- [Foundation 5+](http://foundation.zurb.com/) an advanced responsive framework.
- [Font Awesome 4+](http://fontawesome.io/) which comes with 585+ icons.

Recommended
-----------

[](#recommended)

This bundle will theme for you elements of :

- the [KnpMenuBundle](https://github.com/KnpLabs/KnpMenuBundle) to manage menu or sidebar.
- the [KpnPaginatorBundle](https://github.com/KnpLabs/KnpPaginatorBundle) for pagination.
- the [WhiteOctoberPagerfantaBundle](https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle) for pagination based on Pager Fanta.

Installation and configuration
------------------------------

[](#installation-and-configuration)

```
composer require florianbelhomme/flob-foundation-bundle
```

Then, edit your `app/AppKernel.php` and add:

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            ...
            new Flob\Bundle\FoundationBundle\FlobFoundationBundle(),
            ...
        ];
    }
}
```

You now need to add the libraries to your project.

The easy way to do it (but there are other ways to do so):

```

        ...

        ...

        ...

```

Your project is ready!

Configuration
-------------

[](#configuration)

**This bundle does not theme any elements by default**, in case you want to use Foundation on a specific form or bundle.

To automatically theme forms or other elements by default, go into the `app/config/config.yml` and add at the end:

```
flob_foundation:
    theme: { form: true, knp_menu: true, knp_paginator: true, pagerfanta: true }
```

If you want to do specific HTML markup that extends templates of this bundle:

- create your template in your bundle
- add `{% extends 'FlobFoundationBundle:Form:foundation_form_div_layout.html.twig' %}` at the top (the form template, for example)
- edit the `app/config/config.yml`:

```
flob_foundation:
    theme: { form: true, knp_menu: true, knp_paginator: true, pagerfanta: true }
    template:
        form: 'YourBundle:YourFolder:formtemplate.html.twig'
        breadcrumb: 'YourBundle:YourFolder:breadcrumbtemplate.html.twig'
        knp_menu: 'YourBundle:YourFolder:menutemplate.html.twig'
        knp_paginator: 'YourBundle:YourFolder:paginatortemplate.html.twig'
        pagerfanta: 'YourPagerFantaTemplate'
```

Usage
-----

[](#usage)

### Theme

[](#theme)

However instead of setting it in the configuration, you can theme specific elements using one of these methods:

```
{# Form #}
{% form_theme yourform 'FlobFoundationBundle:Form:foundation_form_div_layout.html.twig' %}

{# Menu #}
{{ knp_menu_render('yourmenu', {'template' : 'FlobFoundationBundle:Menu:foundation_knp_menu.html.twig'}) }}

{# Pagination with KNP paginator #}
{{ knp_pagination_render(yourpagination, 'FlobFoundationBundle:Pagination:foundation_sliding.html.twig') }}

{# Pagination with PagerFanta (through WhiteOctober bundle) #}
{{ pagerfanta(paginationFanta, 'foundation') }}
```

### Top bar

[](#top-bar)

To create a top bar, just create your KNP Menu, add a route to the root element and set extra options:

```
$menu = $this->factory->createItem(
    'My website',
    [
        'route' => 'homepage',
        'extras' => ['menu_type' => 'topbar']
    ]
);
```

### Menu entries with icons

[](#menu-entries-with-icons)

You can add an icon before, after or instead of the label. By default the icon will be added before the label. The icon must be the name of one of Font-Awesome, example : "fa-bell-o".

```
$menu->addChild(
    "Entry",
    [
        'route' => 'route_entry',
        'extras' => [
            'icon' => 'fa-bell-o',
            'icon_position' => 'no-label' # can be 'before', 'after' or 'no-label'
        ]
    ]
);
```

### Breadcrumb

[](#breadcrumb)

If you want a breadcrumb generated from a KNP Menu add this code in your template :

```
{{ flob_foundation_breadcrumb_render('yourknpmenu') }}
```

If you want a specific template :

```
{{ flob_foundation_breadcrumb_render('yourknpmenu', {'template' : 'YourBundle:YourFolder:breadcrumbtemplate.html.twig') }}
```

### Slider (form field type)

[](#slider-form-field-type)

You can now use the slider in your forms.

The slider extend the [number field type](http://symfony.com/doc/current/reference/forms/types/number.html), so it has the same options. The additional options are :

- start : type: integer / default: 0 This specifies the starting point number.
- end : type: integer / default: 100 This specifies the highest number in the range.
- step : type: integer / default: 1 This specifies the cursor's incremental skip.
- vertical : type: boolean / default: false If true, displays the slider vertically instead of horizontally.

This is an example of the field :

```
$builder->add('My slider', 'slider', ['label' => 'Slider', 'start' => 10, 'end' => 20, 'step' => 2]);
```

### Switch (form field type)

[](#switch-form-field-type)

You can now use the switch in your forms.

The switch extend the [choice field type](http://symfony.com/doc/current/reference/forms/types/number.html), so it have the same options. But you can't set the option "expanded" to false (cannot be a select).

This is an example of the field :

```
$builder->add('switch_radio', 'switch', ['label' => 'Switch (as radio)', 'choices' => [1 => 'Choice 1', 2 => 'Choice 2', 3 => 'Obi wan kenobi'], 'multiple' => false]);
```

### Button Group (form field type)

[](#button-group-form-field-type)

You can now use [button groups](http://foundation.zurb.com/docs/components/button_groups.html) in your forms.

Button groups are button, grouped together by Foundation. This way they are rendered on the same line, instead of all on a different row.

This is an example of the field :

```
$builder->add(
    'buttons',
    'button_group',
    [
        'label' => 'Buttons group',
        'buttons' => [
            'back' => [
                'type'    => 'button',
                'options' => [
                    'label' => 'Cancel',
                    'attr' => [
                        'class' => 'secondary',
                    ],
                ],
            ],
            'save' => [
                'type'    => 'submit',
                'options' => [
                    'label' => 'Submit',
                ],
            ],
        ],
        'attr' => [
            'class' => 'right',
        ],
    ]
);
```

In the `buttons` array, you define the buttons that need to be rendered. All the buttons should be of FormType `ButtonType`. For the `ButtonType`, you cannot specify behavior in [Symfony](http://symfony.com/doc/current/reference/forms/types/button.html). You can change the type to `reset` , to render a button with `type="reset"`, (a `ResetType`) but cannot add links.

However, you have various options:

- add an `onClick` tag to the `attr` array
- add a class `link`, a tag `data-url` to the `attr` array and let JavaScript handle it

### Button Bar (form field type)

[](#button-bar-form-field-type)

A button bar is a group of button groups, perfect for situations where you want groups of actions that are all related to a similar element or page.

This is an (long :D) example of the field :

```
$builder->add(
    'button_bar',
    'button_bar',
    [
        'button_groups' => [
            'button_group_first' => [
                'label' => 'Buttons group',
                'buttons' => [
                    'one' => [
                        'type'    => 'submit',
                        'options' => [
                            'label' => 'one',
                        ],
                    ],
                    'two' => [
                        'type'    => 'button',
                        'options' => [
                            'label' => 'two',
                            'attr' => [
                                'class' => 'success',
                            ],
                        ],
                    ],
                    'three' => [
                        'type'    => 'button',
                        'options' => [
                            'label' => 'three',
                            'attr' => [
                                'class' => 'alert',
                            ],
                        ],
                    ],
                ],
                'attr' => [
                    'class' => 'round',
                ],
            ],
            'button_group_second' => [
                'label' => 'Buttons group',
                'buttons' => [
                    'four' => [
                        'type'    => 'button',
                        'options' => [
                            'label' => 'four',
                            'attr' => [
                                'class' => 'disabled',
                            ],
                        ],
                    ],
                    'five' => [
                        'type'    => 'button',
                        'options' => [
                            'label' => 'five',
                            'attr' => [
                                'class' => 'secondary',
                            ],
                        ],
                    ],
                    'six' => [
                        'type'    => 'button',
                        'options' => [
                            'label' => 'six',
                            'attr' => [
                                'class' => 'secondary',
                            ],
                        ],
                    ],
                ],
                'attr' => [
                    'class' => 'radius',
                ],
            ],
        ],
    );
```

Authors
-------

[](#authors)

- [Florian Belhomme](http://florianbelhomme.com) a.k.a Solune
- [The Community Contributors](https://github.com/florianbelhomme/FlobFoundationBundle/graphs/contributors)

Contribute
----------

[](#contribute)

**Contributions to the package are always welcome! Feedback is great.**

Feel free to fork the project and make a PR. You can also help the others, look in the [issues](https://github.com/florianbelhomme/FlobFoundationBundle/issues).

Support
-------

[](#support)

If you are having problems, fill an [issue](https://github.com/florianbelhomme/FlobFoundationBundle/issues).

License
-------

[](#license)

This bundle is licensed under the [MIT License](http://opensource.org/licenses/MIT)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 89.6% 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 ~93 days

Recently: every ~122 days

Total

12

Last Release

3529d ago

Major Versions

1.0.5 → 2.0.02015-02-19

2.1.0 → 3.0.02016-01-05

PHP version history (3 changes)1.0.1PHP &gt;=5.3.3

2.1.0PHP &gt;=5.3.9

3.0.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f3a80b7b532d62003692a9d7645b25f8c552a359f16d66c607bcb8f79736f85?d=identicon)[florianbelhomme](/maintainers/florianbelhomme)

---

Top Contributors

[![flobb](https://avatars.githubusercontent.com/u/4208880?v=4)](https://github.com/flobb "flobb (86 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (6 commits)")[![ifdattic](https://avatars.githubusercontent.com/u/966877?v=4)](https://github.com/ifdattic "ifdattic (2 commits)")[![khasinski](https://avatars.githubusercontent.com/u/702380?v=4)](https://github.com/khasinski "khasinski (1 commits)")[![Raphy](https://avatars.githubusercontent.com/u/3496595?v=4)](https://github.com/Raphy "Raphy (1 commits)")

---

Tags

symfonybundlefoundationresponsivezurb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/florianbelhomme-flob-foundation-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/florianbelhomme-flob-foundation-bundle/health.svg)](https://phpackages.com/packages/florianbelhomme-flob-foundation-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M376](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.7k8.7k1](/packages/kimai-kimai)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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