To see the bundle and its capabilities online just have a look on MopaBootstrapBundle Live
- MopaBootstrapBundle - Easy integration of twitters bootstrap into symfony2
- MopaBootstrapSandboxBundle - Seperate live docs from code
- symfony-bootstrap-sandbox is also available
MopaBootstrapSandboxBundle is a demo case howto use the MopaBootstrapBundle.
To use this in any of your projects (e.g. to make changes in MopaBootstrapBundle and see if it affects the Sandbox)
For detailed installation instructions also have a look into MopaBoostrapBundle Documentation
if you are using sf 2.0.x with composer use:
{
"require": {
"mopa/bootstrap-sandbox-bundle": "2.0.x-dev"
}
}
and run
composer.phar update
if you are using sf 2.0.x with deps use:
[MopaBootstrapSandboxBundle]
git=http://github.com/phiamo/MopaBootstrapSandboxBundle.git
target=/bundles/Mopa/Bundle/BootstrapSandboxBundle
version=origin/v2.0.x
[KnpMenuBundle]
git = "http://github.com/KnpLabs/KnpMenuBundle.git"
target = "/bundles/Knp/Bundle/MenuBundle"
[knp-components]
git=http://github.com/KnpLabs/knp-components.git
[knpmenu]
git = "http://github.com/KnpLabs/KnpMenu.git"
target = "/knpmenu"
add to autoload.php
// ...
'Mopa' => __DIR__.'/../vendor/bundles',
'Knp\\Component' => __DIR__.'/../vendor/knp-components/src',
'Knp\\Menu' => __DIR__.'/../vendor/knpmenu/src',
'Knp\\Bundle' => __DIR__.'/../vendor/bundles',
// ...
and to AppKernel.php
// ...
new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
new Mopa\Bundle\BootstrapSandboxBundle\MopaBootstrapSandboxBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
// ...
and run
bin/vendors install
If you are not using the https://github.com/phiamo/symfony-bootstrap-sandbox You have to configure your project a little bit further.
For this to work its required to have less installed:
config.yml:
# Twig Configuration (as proposed in https://github.com/phiamo/MopaBootstrapBundle/blob/master/README.md)
twig:
form:
resources:
- 'MopaBootstrapBundle:Form:fields.html.twig'
# Assetic Configuration
assetic:
filters:
less:
node: /usr/bin/node
node_paths: [/opt/lessc/lib, /usr/lib/node_modules]
apply_to: "\.less$"
# activate navbar component
mopa_bootstrap:
navbar: ~
routing.yml:
MopaBootstrapSandbox:
resource: "@MopaBootstrapSandboxBundle/Controller"
type: annotation
this imports the routes to be abled to access it in your browser via: