apnet/bootstrap

This package is abandoned and no longer maintained. No replacement package was suggested.

Bootstrap for AsseticImporter

3.3.4.1 2016-07-08 15:21 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:34:24 UTC


README

Installation

Add requirements to composer.json:

{
  "require" : {
    "apnet/bootstrap" : "~3.1,<4.0"
  }
}

Configurations

Register ApnetAsseticImporterBundle bundle in the AppKernel.php file

// ...other bundles ...
$bundles[] = new Apnet\AsseticImporterBundle\ApnetAsseticImporterBundle();

Add Bootstrap importer to services.yml

services:
    # bootstrap3 default css
    apnet.assetic.importer.bootstrap_css:
        parent: assetic.importer_path
        arguments:
            - %kernel.root_dir%/../vendor/apnet/bootstrap/app/Resources/assets/stylesheets
            - bootstrap
        tags:
            - { name: apnet.assetic.config_mapper }
    # bootstrap3 js
    apnet.assetic.importer.bootstrap_js:
        parent: assetic.importer_path
        arguments:
            - %kernel.root_dir%/../vendor/apnet/bootstrap/app/Resources/assets/javascripts
            - bootstrap
        tags:
            - { name: apnet.assetic.config_mapper }

Twig

To include Bootstrap into Twig template use imported_asset function:

<link href="{{ imported_asset('bootstrap/bootstrap.min.css') }}" rel="stylesheet" type="text/css" />

and

<script type="text/javascript" src="{{ imported_asset('bootstrap/bootstrap.min.js') }}"></script>