pedroresende / bootstrapbundle
Twitter Boostrap for Symfony 2
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 0
Language:HTML
Requires
- php: >=5.3.3
This package is not auto-updated.
Last update: 2025-01-16 10:22:41 UTC
README
Install
To install this bundle, please run
$ composer require "pedroresende/bootstrapbundle"
Then run
$ composer update
Add to AppKernel.php
new PedroResende\BootstrapBundle\BootstrapBundle(),
Finally to routing.yml file
bootstrap_public:
resource: "@BootstrapBundle/Resources/config/routing.yml"
prefix: /bootstrap_bundle
Install assets
$ php app/console assets:install --symlink
Assetic dump
$ php app/console assetic:dump
To use in your templates
CSS
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% stylesheets output='css/bootstrap.min.css'
'@bootstrap_css' filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}" type="text/css"/>
{% endstylesheets %}
JS
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
{% javascripts output='js/bootstrap.min.js'
'@bootstrap_js'
%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
You can always simply extend the existing template by using
{% extends 'BootstrapBundle::layout.html.twig' %}
{% block body %}
<div class="container">
{% block container %}{% endblock %}
</div>
{% endblock %}