BraincraftedBootstrapBundle helps you integrate Bootstrap in your Symfony2 project. BootstrapBundle also supports the official Sass port of Bootstrap and Font Awesome.
Developed by Florian Eckerstorfer and amazing contributors.
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.
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.* |
v2.2.* | v2.3.* v2.4.* v2.5.* v2.6.* v2.7.* v2.8.* v3.0.* |
v3.0.* v3.1.* v3.2.* sass v3.2.* |
v1.10.* v1.11.* |
responsive-embed.less
(by blaues0cke)danger()
method to FlashMessage (by florianeckerstorfer)bootstrap.scss
(by mioduszewski).btn-small
(by tmilos)label_attr
to checkbox_row
and radio_row
in choice_widget_expanded
(by florianeckerstorfer)web
directory configurable in install
command (by florianeckerstorfer)symfony-bin-dir
(by nifr)nav
class based on depth (by bkosborne)label = false
(by rdohms)false
(by jeroenvds)leafo/scssphp
(by stefanosala)file
widget (by florianeckerstorfer)value
field when empty_value
is not null in choice fieldpreSubmit
errors (by sandello-alkr)head
block in default layoutbootstrap-sass
(by sandello-alkr and florianeckerstorfer)bootstrap.js
path in default layout (by nonlux)raw
filter for form labels (by sandello-alkr)row
from form-groupnav
from child elements (by dylanschoenmakers)file
form type (by hsz)include_responsive
option because Bootstrap 3.0 no longer has a non responsive versionboostrap_money
form type that uses Bootstraps prepend or append style to display the currencypercent
form type uses Bootstraps append style to display the percent signBraincrafted\Bundle\BootstrapBundle
variables.less
bootstrap_set_style
and bootstrap_get_style
Twig functions to globally set the style of formsbootstrap.less
fileweb/
directorybadge
badge_*
(Bootstrap v3.0 does not include multiply badge styles)label_*
are now Twig functionsicon
is now a Twig functionbraincrafted_collection
form typebraincrafted_collection
to bootstrap_collection
widget_col
, label_col
and simple_col
can be defined in form builder (Fixes #113)braincrafted_bootstrap.output_dir
optiondiv.form-group
in choice_widget_expanded
(Fixes #131)col_size
option to set the column size for form widgets (Fixes #127)simple_col
options in textarea_widget
checkbox_row
and radio_widget
(Fixes #118)label_col
, widget_col
, col_size
and simple_col
options in collection widgetsbootstrap_collection
widgetcssrewrite
filter from default Assetic configurationbootstrap_collection
widgets (by wizart)composer.json
(by hason)customize_variables
configuration option into customize
braincrafted_bootstrap.output_dir
option when installing icon fontlabel_col
and widget_col
option for the whole form (by florianeckerstorfer and dirkluijk)style
option in FormBuildertwbs/bootstrap
Bc\Bundle\BootstrapBundle
data-prototype
option in collection fields