Skip to content

yoye/BootstrapBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Installation

  1. Add this bundle to your project:
[BootstrapBundle]
    git=http://github.com/yoye/BootstrapBundle.git
    target=/bundles/Yoye/Bundle/BootstrapBundle

  1. Add namespace
<?php
// app/autoload.php

$loader->registerNamespaces(array(
    // ...
    'Yoye'        => __DIR__.'/../vendor/bundles',
));
  1. Register this bundle
// application/ApplicationKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Yoye\Bundle\BootstrapBundle\YoyeBootstrapBundle(),
        // ...
    );
}

Usage

  1. Alert

You can use alert as macro in your template.

{% import "YoyeBootstrapBundle::alert.html.twig" as alert %}

{{ alert.show('basic') }}
                

In your controller set your flash message.

<?php 

$this->get('session')->setFlash('warning', 'Type your warning message !');
$this->get('session')->setFlash('info', 'Type your info message !');
$this->get('session')->setFlash('success', 'Type your success message !');
$this->get('session')->setFlash('error', 'Type your error message !');
  1. Form

Config your form template:

# Twig Configuration
twig:
    debug:            %kernel.debug%
    strict_variables: %kernel.debug%
    form:
        resources: 
            - 'YoyeBootstrapBundle:Form:fields.html.twig'
  1. Breadcrumb

You can use breadcrumb as macro in your template.

{% import "YoyeBootstrapBundle::breadcrumb.html.twig" as breadcrumb %}

{{ breadcrumb.draw({
    'homepage' : path("homepage"), 
    'You are here !' : none}) }}
                

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages