Skip to content

webeweb/bootstrap-bundle

Repository files navigation

bootstrap-bundle

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version Latest Unstable Version License composer.lock

Integrate Bootstrap theme with Symfony 2.

IMPORTANT NOTICE: This package is still under development. Any changes will be done without prior notice to consumers of this package. Of course this code will become stable at a certain point, but for now, use at your own risk.

Bootstrap bundle

Includes:


Compatibility

PHP HHVM Symfony


Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this package:

$ composer require webeweb/bootstrap-bundle "^1.0"

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

    public function registerBundles() {
        $bundles = [
            // ...
            new WBW\Bundle\BootstrapBundle\BootstrapBundle(),
            new WBW\Bundle\SyntaxHighlighterBundle\SyntaxHighlighterBundle(),
        ];

        // ...

        return $bundles;
    }

Once the bundle is added then do:

$ php bin/console assets:install

Add the wiki routing into the app/config/routing_dev.yml file of your project:

# ...
_bootstrap_wiki:
    prefix:   "/bootstrap"
    resource: "@BootstrapBundle/Resources/config/routing/wiki.yml"

Open your browser at http://localhost:8000/app_dev.php/bootstrap/wiki/twig-extension/code/basic-block


Usage

Template

{# AppBundle/Resources/views/layout.html.twig #}
{% extends "@Bootstrap/layout.html.twig" %}
{% block bootstrapFormTheme %}
    {# your form theme #}
{% endblock %}
{% block bootstrapHeadFavicon %}
    {# your favicons #}
{% endblock %}
{% block bootstrapHeadStyles %}
    {{ parent() }}
    {# your styles #}
{% endblock %}
{% block bootstrapHeadTitle %}{{ parent() }}{# your title #}{% endblock %}
{% block bootstrapBodyClasses %}{{ parent() }}{# your attributes #}{% endblock %}
{% block bootstrapBodyContent %}
    {{ parent() }}
    {# your content #}
{% endblock %}
{% block bootstrapBodyScripts %}
    {{ parent() }}
    {# your scripts #}
{% endblock %}

Testing

To test the package, is better to clone this repository on your computer. Open a command console and execute the following commands to download the latest stable version of this package:

$ mkdir bootstrap-bundle
$ cd bootstrap-bundle
$ git clone git@github.com:webeweb/bootstrap-bundle.git .
$ composer install

Once all required libraries are installed then do:

$ vendor/bin/phpunit

License

bootstrap-bundle is released under the LGPL License. See the bundled LICENSE file for details.