-
-> Make sure you update your namespaces, we changed the Bundles namespace from
-> Mopa\BootstrapBundle
-> to
-> Mopa\Bundle\BootstrapBundle
->
-> You must change the namespace references in:
->
-> * app/AppKernel.php
-> * Your code making use of any MopaBootstrapBundle classes (e.g. Navbar, MenuBuilder, etc.)
-> * Configuration referencing any classes (e.g. service definitions for menu, navbar, etc.)
->
-> For info about the branches read https://github.com/phiamo/MopaBootstrapBundle/wiki/Branches-&-Versions
->
-> If you dont want to care about the twitter/bootstrap dependency, please make sure your [composer.json](https://github.com/phiamo/MopaBootstrapBundle/blob/master/Resources/doc/including_bootstrap.md) is correct
+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.
-
Live Show
+Live Show
+---------
To see the bundle and its capabilities online just have a look on
+
[MopaBootstrapBundle Live](http://bootstrap.mohrenweiserpartner.de/mopa/bootstrap)
-* [MopaBootstrapBundle](http://github.com/phiamo/MopaBootstrapBundle) - Easy integration of twitters bootstrap into symfony2
+Additional Resources:
+
* [MopaBootstrapSandboxBundle](http://github.com/phiamo/MopaBootstrapSandboxBundle) - Seperate live docs from code
* [symfony-bootstrap-sandbox](https://github.com/phiamo/symfony-bootstrap-sandbox) is also available
-
Introduction
-
-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.
-
-It includes:
+Included
+--------
-* twig templates for use with symfony2 Form component
+* 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.
* twig templates for KnpPaginatorBundle (https://github.com/knplabs/KnpPaginatorBundle)
-* twig templates for CraueFormFlowBundle (https://github.com/craue/CraueFormFlowBundle)
-
-
Documentation
-
-Besides this file, there is a growing collection of documentation:
-
-* in the [docs folder](https://github.com/phiamo/MopaBootstrapBundle/tree/master/Resources/doc)
-* in the various examples:
- * [twig templates](https://github.com/phiamo/MopaBootstrapSandboxBundle/tree/master/Resources/views/Examples)
- * [Form Types](https://github.com/phiamo/MopaBootstrapSandboxBundle/tree/master/Form/Type)
- * [Navbar](https://github.com/phiamo/MopaBootstrapSandboxBundle/tree/master/Resources/config/examples)
- * [MenuBuilder](https://github.com/phiamo/MopaBootstrapSandboxBundle/tree/master/Navbar/Example)
-
-
Outline
-
-* [Prerequisites](#Prerequisites)
-* [Installation](#Installation)
-* [Include Bootstrap](#Including)
-* [Using bootstrap in the layout](#Using)
-* [Using bootstrap for Theming](#Theming)
-* [Field Collections](#Field_Collections)
-* [Generation of CRUD controllers based on a Doctrine 2 schema](#Generation_CRUD)
-* [Generating a Navbar](#NAVBAR)
-* [TODO](#TODO)
-* [Known Issues](#Known_Issues)
-
-
Prerequisites
-
-
Less (recommended)
-
-Less is not required, but is extremely helpful when using bootstrap2 variables, or mixins,
-If you want to have a easier life, have a look into:
-
-[Less Documentation](https://github.com/phiamo/MopaBootstrapBundle/blob/master/Resources/doc/less_installation.md)
-
-
Installation
-
-1. Add this bundle to your project in composer.json:
-
- symfony 2.1 uses composer (http://www.getcomposer.org) to organize dependencies:
-
- To have composer managing twitters bootstrap too, you can either run it with
- --install-suggests or add the following to your composer.json:
-
- ```json
- {
- "require": {
- "mopa/bootstrap-bundle": "dev-master",
- "twitter/bootstrap": "master"
- },
- "repositories": [
- {
- "type": "package",
- "package": {
- "version": "master", /* whatever version you want */
- "name": "twitter/bootstrap",
- "source": {
- "url": "https://github.com/twitter/bootstrap.git",
- "type": "git",
- "reference": "master"
- },
- "dist": {
- "url": "https://github.com/twitter/bootstrap/zipball/master",
- "type": "zip"
- }
- }
- }
- ]
- }
- ```
-
-
Warning
- > Composer doesn't install suggests from mopa/boostrap-bundle!
- > If you need e.g knplabs menues or paginator, craue/formflow,
- > please add them to YOUR composer.json too!
-
- ```json
- {
- "require": {
- "mopa/bootstrap-bundle": "dev-master",
- "twitter/bootstrap": "master",
- "knplabs/knp-paginator-bundle": "dev-master",
- "knplabs/knp-menu-bundle": "dev-master",
- "craue/formflow-bundle": "dev-master"
- },
- "repositories": [
- {
- "type": "package",
- "package": {
- "version": "master", /* whatever version you want */
- "name": "twitter/bootstrap",
- "source": {
- "url": "https://github.com/twitter/bootstrap.git",
- "type": "git",
- "reference": "master"
- },
- "dist": {
- "url": "https://github.com/twitter/bootstrap/zipball/master",
- "type": "zip"
- }
- }
- }
- ]
- }
- ```
-
- To activate auto symlinking and checking after composer update/install add also to your existing scripts:
- (recommended!)
-
- ```json
- {
- "scripts": {
- "post-install-cmd": [
- "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
- ],
- "post-update-cmd": [
- "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
- ]
- }
- }
- ```
-
- There is also a console command to check and / or install this symlink:
-
- ```bash
- php app/console mopa:bootstrap:install
- ```
-
- With these steps taken, bootstrap should be install into vendor/twitter/bootstrap/ and a symlink
- been created into vendor/mopa/bootstrap-bundle/Mopa/BootstrapBundle/Resources/bootstrap.
-
- 1.1. Include bootstrap manually or in another way:
-
- For including bootstrap there are different solutions, why using this one?
- have a look into [Including Bootstrap](https://github.com/phiamo/MopaBootstrapBundle/blob/master/Resources/doc/including_bootstrap.md)
-
-2. Add this bundle to your app/AppKernel.php:
-
- ``` php
- // application/ApplicationKernel.php
- public function registerBundles()
- {
- return array(
- // ...
- new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
- // ...
- );
- }
- ```
-
-3. Configure routing for bundle if your default is other than annotation:
-
- ``` yaml
- #app/config/routing.yml
- mopa_bootstrap:
- resource: "@MopaBootstrapBundle/Controller/ExamplesController.php"
- type: annotation
- ```
-
-4. If you like configure your config.yml (not mandatory)
-
- ``` yaml
- mopa_bootstrap:
- form:
- show_legend: false # default is true
- show_child_legend: false # default is true
- error_type: block # or inline which is default
- ```
-
-
Using bootstrap in the layout
-
-Have a look at the provided [base.html.twig](https://github.com/phiamo/MopaBootstrapBundle/blob/master/Resources/views/layout.html.twig)
- its a fully working bootstrap layout and might explain howto use it by itself.
-
-To make use of the supplied base.html.twig template just use it, or
-defining a new template:
-
-app/Resources/MopaBootstrapBundle/views/layout.html.twig
-
-```jinja
-{% extends 'MopaBootstrapBundle::base.html.twig' %}
-
-{% block title %}Yourapp{% endblock %}
-
-{# and define more blocks ... #}
-
-```
-
-You are free to overwrite any defined blocks.
-Have a look into the sandbox too:
-
- * http://bootstrap.mohrenweiserpartner.de/mopa/bootstrap/layout
- * https://github.com/phiamo/symfony-bootstrap-sandbox/blob/master/app/Resources/MopaBootstrapBundle/views/layout.html.twig
-
-If you are using less just include the mopabootstrap.less as described in layout.html.twig
-
-``` jinja
-{% stylesheets filter='less,cssrewrite,?yui_css'
- '@MopaBootstrapBundle/Resources/public/less/mopabootstrapbundle.less'
- '@YourNiceBundle/Resources/public/less/*'
-%}
-
-{% endstylesheets %}
-```
-
-If you would like to use the css try this:
-
-```bash
-cd vendor/mopa/bootstrap-bundle/Mopa/BootstrapBundle/Resources/bootstrap
-make
-```
-if it doesnt work, why not use the less way?
-
-``` jinja
-{% block head_style %}
-{% stylesheets filter='cssrewrite,?yui_css'
- '@MopaBootstrapBundle/Resources/bootstrap/bootstrap.css'
- '@YourNiceBundle/Resources/public/css/*'
-%}
-
-{% endstylesheets %}
-```
-
-
Using bootstrap for Theming
-
-
-Forms can either be activated for you whole project (app/config.yml):
-
-``` yaml
-twig:
- form:
- resources:
- - 'MopaBootstrapBundle:Form:fields.html.twig'
-```
-
-Or include the fields.html.twig in your template for a special form:
-
-``` jinja
-{% form_theme myform 'MopaBootstrapBundle:Form:fields.html.twig' %}
-```
-
-For FormFlow you can just use MopaBootstrap's templates instead of the ones given by the Bundles:
-
-``` jinja
-{% include 'CraueFormFlowBundle:FormFlow:stepField.html.twig' with {'formident': '#myform}%}
-```
-
-For KnpPaginatorBundle use the following to override template:
-
-```yaml
-# File: app/configs/parameters.yml
-
-parameters:
- knp_paginator.template.pagination: MopaBootstrapBundle:Pagination:sliding.html.twig
-```
-
-where formident is used by jquery to bind the submit form handler to the "next" or "finish" button, instead of the first defined like in html it is
-This is mainly necessary if you have more than one form.
-It need to be the id or class of the form itself
-e.g.
-
-