Developed with love by KnpLabs Hire us for your project!
378

bootstrap-bundle

by braincrafted

BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.

BraincraftedBootstrapBundle

BraincraftedBootstrapBundle helps you integrate Bootstrap in your Symfony2 project. BootstrapBundle also supports the official Sass port of Bootstrap and Font Awesome.

Build Status
Scrutinizer Quality Score
Code Coverage

Latest Stable Version
Total Downloads

Developed by Florian Eckerstorfer and amazing contributors.

Installation

First you need to add braincrafted/bootstrap-bundle to composer.json:

{
   "require": {
        "braincrafted/bootstrap-bundle": "dev-master"
    }
}

Please note that dev-master points to the latest release. If you want to use the latest development version please use dev-develop. Of course you can also use an explicit version number, e.g., 2.1.*.

You also have to add BraincraftedBootstrapBundle to your AppKernel.php:

// app/AppKernel.php
//...
class AppKernel extends Kernel
{
    //...
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Braincrafted\Bundle\BootstrapBundle\BraincraftedBootstrapBundle()
        );
        //...

        return $bundles;
    }
    //...
}

Additionally you have to install Bootstrap and jQuery as dependencies and configure Assetic to compile the LESS files. You can find more information in the Getting Started section of the documentation.

Compatibility

This bundle has two main dependencies, Symfony and Bootstrap. The following table shows which version of BraincraftedBootstrapBundle is compatible with which version of Symfony and Bootstrap.

BootstrapBundle
Symfony
Bootstrap
jQuery




v1.3.*
v2.2.*
v2.3.*
v1.9.*


v1.4.*
v2.2.*
v2.3.*
v1.9.*


v1.5.*
v2.2.*
v3.0.* (very basic)
v1.9.*


v2.0.*v2.1.*
v2.3.*v2.4.*
v3.0.*v3.1.*
v1.10.*v1.11.*


v2.1.*
v2.3.*v2.4.*v2.5.*
v3.0.*v3.1.*v3.2.*sass v3.2.*
v1.10.*v1.11.*

Changelog

Version 2.1.2 (6 March 2015)

  • When restoring form settings, don't throw an exception if there are no settings to restore (by florianeckerstorfer)
  • #356 Add missing responsive-embed.less (by blaues0cke)

Version 2.1.1 (31 January 2015)

Version 2.1.0 (31 August 2014)

Version 2.1.0-beta2 (21 August 2014)

Version 2.1.0-beta1 (29 May 2014)

  • #238 Add empty value field when empty_value is not null in choice field
  • #239 Removed translation_domain from error messages
  • #214 Check for preSubmit errors (by sandello-alkr)
  • #240 Include head block in default layout

Version 2.1.0-alpha1 (16 May 2014)

Version 2.0.1 (3 April 2014)

  • #168 Removed CSS class row from form-group
  • #182 Added support for form actions (row with multiple buttons) (by rdohms)
  • #187 Made default button class changable (by sandello-alkr)
  • #188 Added icons to form buttons (by mvrhov)
  • #190 Added support for stacked tabs (by aur1mas)
  • #192 Added method to reset flash bag (by JulienRamel)
  • #196 Removed CSS class nav from child elements (by dylanschoenmakers)
  • #198 Added parsing of icons in prepend and append input groups (by yvh)
  • Fixed file form type (by hsz)

Version 2.0.0-alpha1

  • Updated to Symfony v2.3.6
  • Updated to Bootstrap v3.0.1
  • Updated to jQuery v1.10.2
  • Remove include_responsive option because Bootstrap 3.0 no longer has a non responsive version
  • Added boostrap_money form type that uses Bootstraps prepend or append style to display the currency
  • percent form type uses Bootstraps append style to display the percent sign
  • Changed namespace back to Braincrafted\Bundle\BootstrapBundle
  • Support for custom variables.less
  • Several Twig filters are now functions
  • Added bootstrap_set_style and bootstrap_get_style Twig functions to globally set the style of forms
  • Added command to generate custom bootstrap.less file
  • Added command to copy icon fonts into web/ directory
  • Added Composer script handler for copying icon fonts
  • Pagination now supports disabled links
  • Added Twig function badge
  • Removed Twig filters badge_* (Bootstrap v3.0 does not include multiply badge styles)
  • Twig filters label_* are now Twig functions
  • Twig filter icon is now a Twig function
  • Added braincrafted_collection form type

Version 2.0.0-alpha2

  • Fixed compatibility with PHP 5.3 (Fixes #111)
  • Renamed braincrafted_collection to bootstrap_collection
  • widget_col, label_col and simple_col can be defined in form builder (Fixes #113)
  • Add support for input groups
  • Fix bug with inline forms when no placeholder is defined

Version 2.0.0-alpha3

  • Fixed configuration of input groups in form builder (Fixes #115)
  • Fixed trailing slash in braincrafted_bootstrap.output_dir option
  • Fixed undefined variable in pagination template
  • Better tested

Version 2.0.0-beta1

  • Fixed duplicate div.form-group in choice_widget_expanded (Fixes #131)
  • Use correct assets when not using LESS (Fixes #128) [amcgowanca]
  • Add col_size option to set the column size for form widgets (Fixes #127)
  • Add support for simple_col options in textarea_widget
  • Renamed views
  • Add error messages in checkbox_row and radio_widget (Fixes #118)

Version 2.0.0-beta2 (9 December 2013)

  • #133: Fix label_col, widget_col, col_size and simple_col options in collection widgets
  • #136: Added translation to bootstrap_collection widget
  • #137: Removed cssrewrite filter from default Assetic configuration
  • #139: Fix JavaScript for nested bootstrap_collection widgets (by wizart)
  • #140: Improved dependency list in composer.json (by hason)
  • #142: Added translation for help block and error messages
  • #143: Added translation to flash message template (by rdohms)
  • #144: Fix class attribute for checkbox widget (by squaye85)
  • #145: Added possibility to style global error messages
  • Renamed customize_variables configuration option into customize

Version 2.0.0-stable (2 January 2014)

  • #152: Add form name attribute (by nonlux)
  • #154: Fix Bootstrap Collection form type for nested types
  • #155: Use braincrafted_bootstrap.output_dir option when installing icon font
  • #52: Add class option for pagination
  • #148: Add label_col and widget_col option for the whole form (by florianeckerstorfer and dirkluijk)
  • #156: Add support for error messages with parameters (by thanosp)
  • #157: Use print shiv instead of standard shiv (by mvrhov)
  • #161: Set style option in FormBuilder
  • #162: Set depth of navigation.

Version 1.5.0

  • Works with new Bootstrap repository twbs/bootstrap
  • Basic support for Bootstrap v3.0
  • Allow override options in menus
  • Extend from base form layout
  • Fixed problems with removing elemnts in JavaScript collection form type
  • Various other bugfixes

Version 1.4.0

  • Changed namespace to Bc\Bundle\BootstrapBundle
  • Automatically configure Twig
  • Automatically configure KnpMenuBundle
  • Automatically configure KnpPaginatorBundle
  • Automatically configure Assetic
  • Improved layout of error messages in compound fields
  • Improved code style (usage of PHP_CodeSniffer and PHPMD)
  • Support for data-prototype option in collection fields
  • Helper and template for flash messages

Version 1.2.0

  • Added support for Assetic

License

  • The bundle is licensed under the MIT License
  • The CSS and Javascript files from Twitter Bootstrap are licensed under the Apache License 2.0 for all versions before 3.1
  • The CSS and Javascript files from Twitter Bootstrap are licensed under the MIT License for 3.1 and after
The MIT License (MIT)

Copyright (c) 2012-2013 Florian Eckerstorfer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
braincrafted_bootstrap:
output_dir:
assets_dir: %kernel.root_dir%/../vendor/twbs/bootstrap
fontawesome_dir: %kernel.root_dir%/../vendor/fortawesome/font-awesome
jquery_path: %kernel.root_dir%/../vendor/jquery/jquery/jquery-1.11.1.js
fonts_dir: %kernel.root_dir%/../web/fonts
less_filter: less
icon_prefix: glyphicon
icon_tag: span
customize:
variables_file: ~
bootstrap_output: %kernel.root_dir%/Resources/less/bootstrap.less
bootstrap_template: BraincraftedBootstrapBundle:Bootstrap:bootstrap.less.twig
auto_configure:
assetic: true
twig: true
knp_menu: true
knp_paginator: true
  • Fix tests
    By florianeckerstorfer, 2 years ago
  • Update README for v2.1.2
    By florianeckerstorfer, 2 years ago
  • Don't throw exception if no settings to restore
    By florianeckerstorfer, 2 years ago
  • Merge pull request #356 from SocialbitGmbH/fix/missing-responsive-embed
    By florianeckerstorfer, 2 years ago
  • Added the missing less file.
    By , 2 years ago
  • Update README for v2.1.1
    By florianeckerstorfer, 2 years ago
  • Add .form-group class to button_row in every style
    By florianeckerstorfer, 2 years ago
  • Include default variables.(less|scss) when using custom bootstrap.(less|scss)
    By florianeckerstorfer, 2 years ago
  • Fix bug that caused the name of a widget not being used as placeholder in inline-style forms
    By florianeckerstorfer, 2 years ago
  • Merge pull request #344 from b-b3rn4rd/develop
    By florianeckerstorfer, 2 years ago
  • Merge pull request #345 from althaus/patch-1
    By florianeckerstorfer, 2 years ago
  • Added dismissible alert styling
    By althaus, 2 years ago
  • Exclude iterable attrs from displaying
    By , 2 years ago
  • Merge pull request #341 from acrobat/badge-update
    By florianeckerstorfer, 2 years ago
  • Merge pull request #342 from acrobat/phpcs-fixes
    By florianeckerstorfer, 2 years ago
  • Minor phpcs fixes
    By acrobat, 2 years ago
  • Use svg instead of png to get better image quality
    By acrobat, 2 years ago
  • Merge pull request #337 from tmilos/btn-small
    By florianeckerstorfer, 2 years ago
  • Invalid class name btn-small in bootstrap_collection_widget #336
    By , 2 years ago
  • Merge pull request #328 from kamiramix/develop
    By florianeckerstorfer, 2 years ago
  • Merge pull request #329 from KatharinaSt/develop
    By florianeckerstorfer, 2 years ago
  • Removed invalid statement
    By , 2 years ago
  • Add the parse_icons function for bootstrap_collection buttons after the translate
    By jeremy, 2 years ago
  • Add the parse_icons function for bootstrap_collection buttons
    By , 2 years ago
  • Merge pull request #320 from e3media/develop
    By florianeckerstorfer, 2 years ago
  • Adjust bootstrap.scss-file
    By , 2 years ago
  • Merge pull request #316 from vith/fix_nested_subform_settings
    By florianeckerstorfer, 2 years ago
  • Restore parent form's settings when subform ends
    By , 2 years ago
  • Merge pull request #315 from braincrafted/flash-danger
    By florianeckerstorfer, 2 years ago
  • Merge pull request #312 from tiagobrito/develop
    By florianeckerstorfer, 2 years ago