Integrate Bootstrap theme with Symfony 2 and more
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

bootstrap-bundle

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

Integrate Bootstrap theme with Symfony 2 and more.

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 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\CoreBundle\CoreBundle(),
            new WBW\Bundle\BootstrapBundle\BootstrapBundle(),
            new WBW\Bundle\SyntaxHighlighterBundle\SyntaxHighlighterBundle(),
        ];

        // ...

        return $bundles;
    }

Once the bundle is added then do:

$ php bin/console wbw:core:unzip-assets
$ 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 bootstrapFavicons %}
    {# your favicons #}
{% endblock %}

{% block bootstrapStylesheets %}
    {{ parent() }}
    {# your styles #}
{% endblock %}

{% block bootstrapTitle %}{{ parent() }}{# your title #}{% endblock %}

{% block bootstrapBodyClasses %}{{ parent() }}{# your attributes #}{% endblock %}

{% block bootstrapBodyContent %}
    {{ parent() }}
    {# your content #}
{% endblock %}

{% block bootstrapJavascripts %}
    {{ 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 https://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.