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

MopaBootstrapBundle

by phiamo

Easy integration of twitters bootstrap into symfony2

MopaBootstrapBundle

Build Status

MopaBootstrapBundle is a collection of code to integrate twitter's bootstrap
(http://twitter.github.com/bootstrap/) as easy as possible into your symfony2
(http://www.symfony.com) Project.

Check out the Beta-4

To use MopaBootstrapBundle and twitters Bootstrap 3 in your project add it via composer

NOTICE:

Recent BC breaks:

  • dc4fd12: [BC Break] Removed inline completely
  • add75e9: Renamed config mopa_bootstrap.navbar to mopa_bootstrap.menu
  • eb9166f: Pass options in mopa_bootstrap_render to the menu provider (unlikely BC)

BS3 (master branch of this bundle) is nearly stable see Beta-4
BS2 (v2.3.x) is quite stable

BC breaking changes will probably not be ported to 2.3.

Branches

To use this bundle with bootstrap 3 use the latest release:

composer require mopa/bootstrap-bundle twbs/bootstrap

To use this bundle with bootstrap SASS with the current master branch:

{
    "require": {
        "mopa/bootstrap-bundle": "v3.0.0-beta4",
        "twbs/bootstrap-sass": "~3.3.0"
    }
}

If you wish to use the current master branch, then use the following:

composer require mopa/bootstrap-bundle:dev-master twbs/bootstrap:dev-master

For bootstrap 2 use the v2.3.x branch:

composer require mopa/bootstrap-bundle:2.3.x-dev twbs/bootstrap:2.3.2

To understand which versions are currently required have a look into BRANCHES.md

Documentation

The bulk of the documentation is stored in the Resources/doc/index.md file in this bundle
In any case, if something is not working as expected after a update:

Recent BackwardsCompatibility breaking changes:

  • c892cd9: Changed the way how navbars are created, read the doc
  • a4b78d5: Added Version Detection for BS2 or BS3
  • 5f1200f: Changed the widget_addon form parameter to use type (prepend/append) instead of append (true/false)

Live Show

To see the bundle, its capabilities and some more doc just have a look on

MopaBootstrapBundle Live

Additional Resources:

Installation

Installation instructions are located in the

Included Features

  • Bootstrap Version detection via Composer Bridge
  • Twig Extensions and templates for use with symfony2 Form component
    • control your form either via the form builder or the template engine
    • control nearly every bootstrap2 form feature
    • javascript and twig blocks for dynamic collections
  • A generic Navbar class to generate your Navbar outside the template
    • helpers for dropdowns, seperators, etc.
  • A generic Tab class to Manage bootstrap tabbing
  • twig templates for KnpPaginatorBundle (https://github.com/knplabs/KnpPaginatorBundle)
  • twig templates for CraueFormFlowBundle (https://github.com/craue/CraueFormFlowBundle)
  • twig template for KnpMenuBundle (https://github.com/KnpLabs/KnpMenuBundle)
    • icon support on menu links

Recently added Features

Tabs
We need to add more info here

Bootstrap 3

We now officially suport bootstrap3 in our master branch.

Dynamic SubnavBars

To kick start your Navigation, the Navbar component got some face lift.
It got even easier to integrate also the dynamic sub navbar you might have seen in the twitter bootstrap docs.

To learn how to use this features read Navbar docs (4-navbar-generation).

Also have a look into the Sandbox

initializr

To make your base HTML5 even better and let you use good practices we added
to this bundle features from HTML5 BoilerPlate Project.
Integration was done using setup pregenerated with support of Initializr.
Actually we support HTML5 BoilerPlate v3.0.3 with Modernizr v2.5.3 and Respond.

To learn how to use this features read Initializr docs (50-Initializr.md).

Warning

The branching strategy has been adapted to be more flexible:
* The old branch for bootstrap 1.x (v1.x) still exists.
* The v2.0.x (previously v2.x_sf2.0) branch is following Symfony 2.0.x with bootstrap 2.x
* The master branch is following Symfony master with bootstrap 2.x
* The master-crud branch is following Symfony master with bootstrap 2.x but still has the CRUD Generator, which depends on SensioGeneratorBundle

Translations

If you use KnpPaginatorBundle with MopaBootstrapBundle, you can translate labels to your language.
To do this add new file

Resources/translations/pagination.[YOUR LOCALE CODE].yml

As example you have there Polish translation.

Contribute

If you want to contribute your code to MopaBootstrapBundle please be sure that your PR's
are valid to Symfony2.1 Coding Standards. You can automatically fix your code for that
with PHP-CS-Fixer tool.

You can see who already contributed to this project on Contributors page

License

This bundle is under the MIT license. For more information, see the complete LICENCE file in the bundle.

Copyright (c) 2011 Mohrenweiser & Partner, Philipp A. Mohrenweiser
- http://www.mohrenweiserpartner.de

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.
mopa_bootstrap:
version: ~
form:
templating: MopaBootstrapBundle:Form:fields.html.twig
horizontal_label_class: col-lg-3
horizontal_input_wrapper_class: col-lg-9
row_wrapper_class: form-group
render_fieldset: true
render_collection_item: true
show_legend: true
show_child_legend: false
checkbox_label: both
render_optional_text: true
render_required_asterisk: false
error_type: ~
tooltip:
icon: icon-info-sign
placement: top
tabs:
class: nav nav-tabs
popover:
icon: icon-info-sign
placement: top
collection:
widget_remove_btn:
attr:
class: btn
icon: ~
icon_color: ~
widget_add_btn:
attr:
class: btn
icon: ~
icon_color: ~
navbar:
template: MopaBootstrapBundle:Navbar:navbar.html.twig
initializr:
meta:
title: MopaBootstrapBundle
description: MopaBootstrapBundle
keywords: MopaBootstrapBundle, Twitter Bootstrap, HTML5 Boilerplate
author_name: My name
author_url: #
feed_atom: ~
feed_rss: ~
sitemap: ~
nofollow: false
noindex: false
dns_prefetch:

# Default:
- //ajax.googleapis.com
google:
wt: ~
analytics: ~
diagnostic_mode: false
  • Merge pull request #1036 from emil-nasso/patch-1
    By phiamo, 2 years ago
  • Update 6-icons.md
    By , 2 years ago
  • added blocks to test
    By phiamo, 2 years ago
  • fixed ugly typo
    By phiamo, 2 years ago
  • fixing missing end and intendation
    By phiamo, 2 years ago
  • Merge pull request #1017 from NightFox7/master
    By phiamo, 2 years ago
  • Merge pull request #1021 from LouTerrailloune/patch-2
    By phiamo, 2 years ago
  • Merge pull request #1020 from LouTerrailloune/patch-1
    By phiamo, 2 years ago
  • Corrected link to the Live demo site
    By LouTerrailloune, 2 years ago
  • Fixed form configuration
    By LouTerrailloune, 2 years ago
  • Replace col-sm-4 with date_wrapper_class
    By NightFox7, 2 years ago
  • Merge pull request #1019 from auipga/patch-2
    By phiamo, 2 years ago
  • Merge pull request #1018 from auipga/patch-1
    By phiamo, 2 years ago
  • Updated @icon-font-path
    By auipga, 2 years ago
  • make $icon-font-path able to override
    By auipga, 2 years ago
  • Merge pull request #999 from mrcmorales/master
    By phiamo, 2 years ago
  • added compatibility with symfony 2.3
    By mrcmorales, 2 years ago
  • Merge pull request #1012 from paljinov/master
    By phiamo, 2 years ago
  • Split tests to correlate to their extension.
    By isometriks, 2 years ago
  • smalot/bootstrap-datetimepicker css added
    By , 2 years ago
  • Simplify tests. Don't render the whole row for every test, just render widget or label depending on what needs to be checked.
    By isometriks, 2 years ago
  • Merge pull request #1011 from isometriks/add-more-tests
    By isometriks, 2 years ago
  • Add tests for addons and required asterisk.
    By isometriks, 2 years ago
  • Merge pull request #1009 from isometriks/sass-3.2-base
    By isometriks, 2 years ago
  • Merge pull request #1010 from isometriks/add-xpath-tests
    By isometriks, 2 years ago
  • Add build icon
    By isometriks, 2 years ago
  • Fix travis to build dev-master symfony
    By isometriks, 2 years ago
  • Add inline row test
    By isometriks, 2 years ago
  • Update travis to not run dev-master without php 5.9
    By isometriks, 2 years ago
  • Add test base class and a sample test.
    By isometriks, 2 years ago