Giter VIP home page Giter VIP logo

bootstrap-bundle's Introduction

BraincraftedBootstrapBundle helps you integrate Bootstrap in your Symfony2 project. BootstrapBundle also supports the official Sass port of Bootstrap and Font Awesome.

Build Status Scrutinizer Quality Score Code Coverage

Latest Stable Version Total Downloads

Developed by Florian Eckerstorfer and amazing contributors.

Installation

First you need to add braincrafted/bootstrap-bundle to composer.json:

{
   "require": {
        "braincrafted/bootstrap-bundle": "dev-master"
    }
}

Please note that dev-master points to the latest release. If you want to use the latest development version please use dev-develop. Of course you can also use an explicit version number, e.g., 2.1.*.

You also have to add BraincraftedBootstrapBundle to your AppKernel.php:

// app/AppKernel.php
//...
class AppKernel extends Kernel
{
    //...
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Braincrafted\Bundle\BootstrapBundle\BraincraftedBootstrapBundle()
        );
        //...

        return $bundles;
    }
    //...
}

Additionally you have to install Bootstrap and jQuery as dependencies and configure Assetic to compile the LESS files. You can find more information in the Getting Started section of the documentation.

Compatibility

This bundle has two main dependencies, Symfony and Bootstrap. The following table shows which version of BraincraftedBootstrapBundle is compatible with which version of Symfony and Bootstrap.

BootstrapBundle Symfony Bootstrap jQuery
v1.3.* v2.2.* v2.3.* v1.9.*
v1.4.* v2.2.* v2.3.* v1.9.*
v1.5.* v2.2.* v3.0.* (very basic) v1.9.*
v2.0.*
v2.1.*
v2.3.*
v2.4.*
v3.0.*
v3.1.*
v1.10.*
v1.11.*
v2.1.* v2.3.*
v2.4.*
v2.5.*
v3.0.*
v3.1.*
v3.2.*
sass v3.2.*
v1.10.*
v1.11.*
v2.2.* v2.3.*
v2.4.*
v2.5.*
v2.6.*
v2.7.*
v2.8.*
v3.0.*
v3.0.*
v3.1.*
v3.2.*
sass v3.2.*
v1.10.*
v1.11.*

Changelog

Version 2.2.0 (23 January 2016)

  • #331 Translate menu labels (by kamiramix)
  • #364 Update form_themes supported keyword to replace the form.resources keyword (by cordoval)
  • #367 Add missing ul tag for list list (by ocetnik)
  • #374 Update to Symfony 2.6 compatible form extensions (by kralos)
  • #376 Upgrade to Symfony 2.6 compatible form types (by althaus)
  • #382 Make use of choice_translation_domain option (by Restless-ET)
  • #383 Add button twig function (by bigfoot90)
  • #384 Fix ScriptHandler to work properly with HHVM (by mdurys)
  • #385 Use url option instead if hread attribute (by bigfoot90)
  • #392 Use icon helper with different icon set (by bigfoot90)
  • #393 Switch twig extesions to use SimpleFunction/SimpleFilter (by dkisselev)
  • #394 Add Twig integration tests for common methods (by dkisselev)
  • #395 Add integration tests for icon, parse_icons, button, button_link Twig extensions (by bigfoot90)
  • #397 Change JS removeField event to allow catch after removing element (by DarekTw)
  • #399 Twig deprecations (by benr77)
  • #404 Fix bc-bootstrap-collection.js .size() deprecations (by jounisuo)
  • #414 Fix compatibility with Symfony 3.0 (by lashus)
  • #417 Replace sameas with same (by bartwesselink)

Version 2.1.2 (6 March 2015)

  • When restoring form settings, don't throw an exception if there are no settings to restore (by florianeckerstorfer)
  • #356 Add missing responsive-embed.less (by blaues0cke)

Version 2.1.1 (31 January 2015)

Version 2.1.0 (31 August 2014)

Version 2.1.0-beta2 (21 August 2014)

Version 2.1.0-beta1 (29 May 2014)

  • #238 Add empty value field when empty_value is not null in choice field
  • #239 Removed translation_domain from error messages
  • #214 Check for preSubmit errors (by sandello-alkr)
  • #240 Include head block in default layout

Version 2.1.0-alpha1 (16 May 2014)

Version 2.0.1 (3 April 2014)

  • #168 Removed CSS class row from form-group
  • #182 Added support for form actions (row with multiple buttons) (by rdohms)
  • #187 Made default button class changable (by sandello-alkr)
  • #188 Added icons to form buttons (by mvrhov)
  • #190 Added support for stacked tabs (by aur1mas)
  • #192 Added method to reset flash bag (by JulienRamel)
  • #196 Removed CSS class nav from child elements (by dylanschoenmakers)
  • #198 Added parsing of icons in prepend and append input groups (by yvh)
  • Fixed file form type (by hsz)

Version 2.0.0-alpha1

  • Updated to Symfony v2.3.6
  • Updated to Bootstrap v3.0.1
  • Updated to jQuery v1.10.2
  • Remove include_responsive option because Bootstrap 3.0 no longer has a non responsive version
  • Added boostrap_money form type that uses Bootstraps prepend or append style to display the currency
  • percent form type uses Bootstraps append style to display the percent sign
  • Changed namespace back to Braincrafted\Bundle\BootstrapBundle
  • Support for custom variables.less
  • Several Twig filters are now functions
  • Added bootstrap_set_style and bootstrap_get_style Twig functions to globally set the style of forms
  • Added command to generate custom bootstrap.less file
  • Added command to copy icon fonts into web/ directory
  • Added Composer script handler for copying icon fonts
  • Pagination now supports disabled links
  • Added Twig function badge
  • Removed Twig filters badge_* (Bootstrap v3.0 does not include multiply badge styles)
  • Twig filters label_* are now Twig functions
  • Twig filter icon is now a Twig function
  • Added braincrafted_collection form type

Version 2.0.0-alpha2

  • Fixed compatibility with PHP 5.3 (Fixes #111)
  • Renamed braincrafted_collection to bootstrap_collection
  • widget_col, label_col and simple_col can be defined in form builder (Fixes #113)
  • Add support for input groups
  • Fix bug with inline forms when no placeholder is defined

Version 2.0.0-alpha3

  • Fixed configuration of input groups in form builder (Fixes #115)
  • Fixed trailing slash in braincrafted_bootstrap.output_dir option
  • Fixed undefined variable in pagination template
  • Better tested

Version 2.0.0-beta1

  • Fixed duplicate div.form-group in choice_widget_expanded (Fixes #131)
  • Use correct assets when not using LESS (Fixes #128) [amcgowanca]
  • Add col_size option to set the column size for form widgets (Fixes #127)
  • Add support for simple_col options in textarea_widget
  • Renamed views
  • Add error messages in checkbox_row and radio_widget (Fixes #118)

Version 2.0.0-beta2 (9 December 2013)

  • #133: Fix label_col, widget_col, col_size and simple_col options in collection widgets
  • #136: Added translation to bootstrap_collection widget
  • #137: Removed cssrewrite filter from default Assetic configuration
  • #139: Fix JavaScript for nested bootstrap_collection widgets (by wizart)
  • #140: Improved dependency list in composer.json (by hason)
  • #142: Added translation for help block and error messages
  • #143: Added translation to flash message template (by rdohms)
  • #144: Fix class attribute for checkbox widget (by squaye85)
  • #145: Added possibility to style global error messages
  • Renamed customize_variables configuration option into customize

Version 2.0.0-stable (2 January 2014)

  • #152: Add form name attribute (by nonlux)
  • #154: Fix Bootstrap Collection form type for nested types
  • #155: Use braincrafted_bootstrap.output_dir option when installing icon font
  • #52: Add class option for pagination
  • #148: Add label_col and widget_col option for the whole form (by florianeckerstorfer and dirkluijk)
  • #156: Add support for error messages with parameters (by thanosp)
  • #157: Use print shiv instead of standard shiv (by mvrhov)
  • #161: Set style option in FormBuilder
  • #162: Set depth of navigation.

Version 1.5.0

  • Works with new Bootstrap repository twbs/bootstrap
  • Basic support for Bootstrap v3.0
  • Allow override options in menus
  • Extend from base form layout
  • Fixed problems with removing elemnts in JavaScript collection form type
  • Various other bugfixes

Version 1.4.0

  • Changed namespace to Bc\Bundle\BootstrapBundle
  • Automatically configure Twig
  • Automatically configure KnpMenuBundle
  • Automatically configure KnpPaginatorBundle
  • Automatically configure Assetic
  • Improved layout of error messages in compound fields
  • Improved code style (usage of PHP_CodeSniffer and PHPMD)
  • Support for data-prototype option in collection fields
  • Helper and template for flash messages

Version 1.2.0

  • Added support for Assetic

License

  • The bundle is licensed under the MIT License
  • The CSS and Javascript files from Twitter Bootstrap are licensed under the Apache License 2.0 for all versions before 3.1
  • The CSS and Javascript files from Twitter Bootstrap are licensed under the MIT License for 3.1 and after

bootstrap-bundle's People

Contributors

acrobat avatar althaus avatar axzx avatar bartwesselink avatar bdemalglaive avatar benglass avatar benr77 avatar bigfoot90 avatar cedriclombardot avatar cordoval avatar derpue avatar dkisselev avatar dkvk avatar egrajeda avatar hsz avatar kamiramix avatar kl3ryk avatar maennchen avatar mhor avatar mumia avatar nifr avatar nonlux avatar ocetnik avatar peshi avatar rdohms avatar restless-et avatar sandello-alkr avatar tarioch avatar webda2l avatar wodka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap-bundle's Issues

KnpMenuBundle Issue

Hi everyone ! First of all, thanks for the GREAT job !!

I configured your menu template as the default template for the KnpMenuBundle which I am using, but I get this error:

Variable "matcher" does not exist in /mnt/sshfs/code/Harren/Sniper/vendor/braincrafted/bootstrap-bundle/Braincrafted/BootstrapBundle/Resources/views/Menu/menu.html.twig at line 100

I tried removing the lines involving the matcher in an overriden template of menu.html.twig, but the menu breaks up ...

Can you point me at the right direction for resolving this? Thanks a lot !! Is kind of urgent ...

I am using Symfony version 2.2.1
Braincrafted version "1.3.1"
KnpMenuBundle version was instaled via composer from the dev-master branch by some bundle needing it, don't recall which one.
On my composer.json I have "knplabs/knp-paginator-bundle": "dev-master",

Error after install

I have this error after fresh install bundle:
Cannot import resource "." from "/var/www/ghtest/app/cache/dev/assetic/routing.yml".
:((

Add class attribute for pagination

Allow to add class attributes like this : {{ knp_pagination_render(pagination, null, {}, {'attr':{'class':'myClass' }}) }}

Thanks a lot.

Remove Assets from Bundle

I would like to remove the Twitter Bootstrap assets (JavaScript, CSS and images) from the bundle repository.

Currently I can see two possibilities to achieve this:

Composer

This is possible (see this StackOverflow answer), but messy. Composer should be used to manage PHP packages, not JavaScript packages.

Bower

Bower is a package manager for JavaScript. There is also a Symfony2 bundle called SpBowerBundle. Without the bundle users would have to add the Bower packages required by BootstrapBundle manually to their ´components.json`, with the bundle they only have to add the bundle to the SpBower configuration. However, it would add another bundle as a dependency to BootstrapBundle.

What do you think?

  1. Composer
  2. Pure Bower
  3. Bower with SpBowerBundle

assetic:dump creates empty bootstrap*.css files ?

I don't know to what extent this is relevant, but I'm trying to use this bundle on a windows 7 x64 machine.

After some tinkering I got node.js and less working, but at this moment assetic:dump creates empty css files, and I have no idea why.

I followed the instructions at http://bootstrap.braincrafted.com/getting-started and the strange thing is that the JS files are created fine, so my assumption is that the node.js and less setup is OK...

Support form_type horizontal and inline also when using new form() function

With symfony 2.3 it is now also possible to simply use {{ form(myForm) }} to render a whole form. Unfortunately the form theme does not yet have specialization for the the according blocks and therefore form_type is not taken into account when actually rendering the

block. Based on the original block, adding

{% block form_start %}
{% spaceless %}
{% set method = method|upper %}
{% if method in ["GET", "POST"] %}
{% set form_method = method %}
{% else %}
{% set form_method = "POST" %}
{% endif %}
{% if form_type is defined %}
{% set attr_form = attr|merge({'class': (attr.class|default('') ~ ' form-' ~ form_type)|trim}) %}
{% else %}
{% set attr_form = attr %}
{% endif %}
<form method="{{ form_method|lower }}" action="{{ action }}"{% for attrname, attrvalue in attr_form %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}>
{% if form_method != method %}

{% endif %}
{% endspaceless %}
{% endblock form_start %}

to form_div_layout.html.twig setups the correct css class based on the form_type.

Radio list - wrong label in forms

Hi,
I made a radio list using Symfony 2.1 forms. Choices field with multiple false and expanded true.
I have added 2 options

choices => [ 0 => Yes, 1 => No ]

Everything was rendered fine. But when I add label:

label => Grupa (instead of default name - group)

all radio buttons ended up with wrong label "Grupa" while I should see Yes/No options.
I didn't have time to fix form template. I just used default Symfony template instead one that was provided with bundle.

Support form_type horizontal for buttons

Please add form_type support for buttons. Currently submit button is supported but changing form_type doesn't make any difference.

I'm not 100% sure, but I think it should be done on:

{% block button_widget %}
....
{% endblock button_widget %}

File not found

Hi,

i m new in symfony, i tried to install this bundle to get bootstrap into my project, everything is oki, i installed this bundle and the other knp-menu with composer, addes the line to the autoload of knp-menu this way:

$loader->add('', __DIR__.'/../vendor/bundles');
$loader->add('', __DIR__.'/../vendor/knp-menu/src');

i added the thing in the config.yml, everything looks correct, i added the include for css and js in my base twig file

when i try to open a page it opens when i look the source everything is correct but when i click on the css path or the js path i got an 404

i m using symfony 2.1, thank you

Collection field

There are a problem with the collection field, the attribut "data-prototype" dont appear on the view.

How to disable LESS?

Actually i'm working on WAMP and haven't foudn a solution to make Less work on windows (i get [Assetic\Exception\FilterException]
An error occurred while running:
"C:\nodejs\node.exe" "C:\Users\Alessandro\AppData\Local\Temp\assFA4B.tmp" Input:
/*!

  • Bootstrap v2.3.1 [...] ) and LessPhp have problem with mixin file of bootstrap 2.3.1

So i decided to use default css/js bootstrap files cloned in the web/ folder as actually i don't need to compile less files.
The problem is that in dev mode it works and Assetic skip the LESS step... in production, also after cache:clear (env=prod) Assetic try anyway to launch LESS on ".css" files... i'm discouraged and i wouldlike to completely remove Less from my symfony installation. Is there some way to do this?

Translation-Support for KNPMenu?

To enable the translation within the KNPMenu i was overriding the Braincrafted menu.html.twig file and changed the last line
from

{% block label %}{% if options.allow_safe_labels and item.getExtra('safe_label', false) %}{{ item.label|raw|parse_icons }}{% else %}{{ item.label|parse_icons }}{% endif %}{% endblock %}

to

{% block label %}{% if options.allow_safe_labels and item.getExtra('safe_label', false) %}{{ item.label|trans(item.getExtra('translation_params', {}), item.getExtra('translation_domain', 'messages'))|raw|parse_icons }}{% else %}{{ item.label|trans(item.getExtra('translation_params', {}), item.getExtra('translation_domain', 'messages'))|parse_icons }}{% endif %}{% endblock %}

That works. But is there any (more elegant) way instead of overriding the bundle to achieve translation?

class not found

When using composer to include this bundle, Symfony returns:
( ! ) Fatal error: Class 'Braincrafted\BootstrapBundle\BraincraftedBootstrapBundle' not found in /*path_to_my_symfony_app/app/AppKernel.php on line 23

I added
new Braincrafted\BootstrapBundle\BraincraftedBootstrapBundle()

to AppKernel and tried adding the path to the autoloader:

$loader->add('', __DIR__.'/../vendor/braincrafted/bootstrap-bundle/Braincrafted/BootstrapBundle');

Then tried to update via composer and clear the cache multiple times. I don't see what I'm doing wrong here :(

Automatically configure Assetic problem

hi,

I ve an issue with the version 1.4.0. In order to generate the file bootstrap.css, i use lessphp. Can you add lessphp to your assetic configuration ?

        lessphp:
            file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php
            apply_to: "\.less$"

Glyphicons not showing

I have created the sym links as you suggested below:

$ ln -s ../../vendor/twitter/bootstrap/img/glyphicons-halflings.png
$ ln -s ../../vendor/twitter/bootstrap/img/glyphicons-halflings-white.png

and they are valid, but no icons appear on my app. (I'm in the app_dev.php environment.)

Thanks for any help.

Ability for a custom Variables.less

Hi All,

I am trying to add a custom variables.less file by doing the following:

assets:
    bootstrap_css:
        inputs:
            - %kernel.root_dir%/../vendor/twitter/bootstrap/less/bootstrap.less
            - %kernel.root_dir%/../vendor/twitter/bootstrap/less/responsive.less
            - %kernel.root_dir%/../src/DABSquared/CurveuBundle/Resources/doc/variables.less

My variables.less file does not seem to be overriding the base bootstrap one. I would prefer not to have to edit the base bootstrap files. Is the correct way of going about this or is their another way I seem to be missing?

Any help would be appreciated Thanks,

Daniel

Were is "_javascripts.html.twig" and "_stylesheets.html.twig" files?

In documentation you wrote:

The Bootstrap for Symfony2 bundle only contains the compiled and not minified versions of the CSS and Javascript files. We recommend using Assetic to minify the files. If you want to compile your own version of Twitter for Bootstrap you can do this. Just look at the content of _javascripts.html.twig and _stylesheets.html.twig, copy the content into your bundle and replace the CSS and JavaScript files with your own.

I can't fined those files in repository.

form error messages not appearing for choice widgets

I'm creating this as a new issue because the scope is much more narrow than it was before.

On a form field that uses a dropdown or checkbox selection, no form errors appear.

Please see if you can reproduce.

form_type - horizontal & form_row

For certain reasons I have to use form_row instead of form_widget.

Is there a way to set form_type : horizontal without using form_widget?

KnpMenu dependency

Hi,

I've just installed the bundle and I encounter this fatal error:

FatalErrorException: Error: Interface 'Knp\Menu\Matcher\Voter\VoterInterface' not found in vendor\braincrafted\bootstrap-bundle\Braincrafted\BootstrapBundle\Voter\RequestVoter.php line 20

As I'm not using KnpMenu theme and don't want to, I don't see why this is a mandatory requirement.

KnpMenu should not be required.

form checkbox doesn't display error-style

I have an issue with a checkbox:

{{ form_row(form.termsAccepted, {'form_type': 'horizontal'}) }}

just shows the normal style

...
with the error-message and not
...

Or am i doing something wrong?

Thx!

Only one divider rendered

When adding dividers in between items only the first is rendered.

$item = $menu->addChild('d1', array('attributes' => array('divider' => true)));

Add config options to manage assetic on my own

Today you are using a config extension to add your generated assetic into my project-config. I want do that on my own and don't like to get it in autmatically, can you provide a config-options which disable that ?

Symfony 2.3 support and Bootstrap 3.0 RC

At the frontpage (of the github page) / readme it shows support for symfony 2.2. Symfony 2.3 is out since a little while and bootstrap 3.0 is already at release candidate and hopefully soon will be at a final version. Does the bootstrap-bundle support symfony 2.3 and bootstrap 3.0 rc ?

Problem with duplicate error message

For example {{ form(form) }} show if an error occurs two equal error messages, its wrong.
But {{ form(form, {'form_type': 'inline'}) }} doesn't.

That's because:

    {% elseif form_type is defined and form_type == 'horizontal' %}
        {{ block('horizontal_row') }}

calls:

    <div class="control-group{% if errors|length %} error{% endif %}{% if validation_state is defined %} {{validation_state}}{% endif %}">
        {{ form_label(form) }}
        <div class="controls">
            {{ form_widget(form) }}
        </div>
    </div>

And form_widget(form) renders field and error.

but {{ form(form) }} renders widget (with input and error) and additionally error again.

So it looks like this one:

bildschirmfoto 2013-07-03 um 17 01 00

boostrap-bundle always overrides (prepends) twig form config

The docs say:
BootstrapBundle automatically styles every form in your application with Twitter Bootstrap. If you want to use a different form theme than the one provided by BootstrapBundle, you can change your Twig configuration

twig:
    form:
        resources:
            - "AcmeBundle:Form:form_div_layout.html.twig"

However, here https://github.com/braincrafted/bootstrap-bundle/blob/develop/DependencyInjection/BcBootstrapExtension.php#L129

the form config is always prepended to any configuration in app/config.yml. That actually means you cannot override the default boostrap-bundle form via app/config.yml as stated in the docs.

Any suggestion how to override "BcBootstrapBundle:Form:form_div_layout.html.twig" is welcome.

app_dev.php not prepended when using assetic

I'm having a problem with

<link rel="stylesheet" href="{{ asset('css/bootstrap.css') }}">

I need to use

<link rel="stylesheet" href="{{ asset('app_dev.php/css/bootstrap.css') }}">

to get things to work okay. Is there something wrong with my configuration?

twitter/bootstrap 2.3.* - no longer exists!

Oh man, I've just returned to Symfony development after a couple of months break and expected to use this bootstrap-bundle like I did before - but Twitter seem to have totally abandoned their 2.3.2 git repo essentially breaking your bundle because you depend on it.

Do you (or anyone) know where we can get a reliable Bootstrap v.2.3.* repo? Then add it to Packagist!

symfony in alias directory

Hi,
i try the bundle, but when I used with symfony install in alias directory, files bootstrap no found (404)

http://localhost/my_directory_demo/app_dev.php

GET http://localhost/bundles/braincraftedbootstrap/js/bootstrap.js 404 (Not Found) WorlZZZ:24
GET http://localhost/bundles/braincraftedbootstrap/css/bootstrap.css 404 (Not Found) WorlZZZ:6
GET http://localhost/bundles/braincraftedbootstrap/css/bootstrap-responsive.css 404 (Not Found)

Can I add my_directory_demo/ to url?
Sorry my poor english. Thanks

P.S.
My template using

{% include 'BraincraftedBootstrapBundle::_stylesheets.html.twig' %}

...

{% include 'BraincraftedBootstrapBundle::_javascripts.html.twig' %}

Add icons to the menu

Hello, I'm trying out your bundle. I've created a menu and now I'm wondering how to add icons before menu labels.

Is this possible ?

Thanks

Twitter bootstrap icons problem

Hi,
after installing 1.3.1 in my project and applying new configuration - bootstrap icons are missing.

http://example.com/img/glyphicons-halflings.png 404 (Not Found)

My config:

Assetic Configuration

assetic:
debug: %kernel.debug%
use_controller: false
bundles: [ StypendiumBundle ]
filters:
less:
node: /usr/bin/node
node_paths: [/usr/lib/node_modules]
apply_to: ".less$"
cssrewrite: ~
assets:
bootstrap_css:
inputs:
- %kernel.root_dir%/../vendor/twitter/bootstrap/less/bootstrap.less
- %kernel.root_dir%/../vendor/twitter/bootstrap/less/responsive.less
filters:
- less
- cssrewrite
output: css/bootstrap.css
bootstrap_js:
inputs:
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-transition.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-alert.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-button.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-carousel.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-collapse.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-dropdown.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-modal.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-tooltip.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-popover.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-scrollspy.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-tab.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-typeahead.js
- %kernel.root_dir%/../vendor/twitter/bootstrap/js/bootstrap-affix.js
output: js/bootstrap.js
jquery:
inputs:
- %kernel.root_dir%/../vendor/jquery/jquery/jquery-1.9.1.js
output: js/jquery.js

Bootsrap-bundle doesn't work with knplabs/knp-menu-bundle v1.1.x-dev

I've been working with symfony 2.1 and 2.2. The point is at the beginning I was using knplabs/knp-menu-bundle dev-master as v1.1.0, then bootstrapmenubundle was working fine. The problem began when I ran composer.phar update due to I added a new bundle, composer asked me for the new dev version of knplabs/knp-menu-bundle, then when I check my environment I watched the following error: Variable "matcher" does not exist in /BraincraftedBootstrapBundle/views/Menu/menu.html.twig at line 100.

Item "nav_type" for "Array" does not exist in BraincraftedBootstrapBundle:Menu:menu.html.twig at line 111

the error message:

Item "nav_type" for "Array" does not exist in
BraincraftedBootstrapBundle:Menu:menu.html.twig at line 111

my twig line:

{{ knp_menu_render('BattlemamonoMainBundle:Builder:settingSidebarMenu') }}

my menu builder function:

public function settingSidebarMenu(FactoryInterface $factory, array $options)
{
    $menu = $factory->createItem('settingSidebar');
    $menu->setChildrenAttribute('class', 'sidenav');
    $menu->addChild('What is Battlemamono?', array(
            'uri' => '#whatis',
            ));
    $menu->addChild('History', array(
            'uri' => '#history',
    ));

    $menu->addChild('Mamono', array(
            'uri' => '#mamono',
    ));

    $menu['Mamono']->addChild('Evolution', array(
            'uri' => "#evolution",
    ));


    $menu->addChild('Humans', array(
            'uri' => '#humans',
    ));
    $menu->addChild('Loci Beast', array(
            'uri' => '#loci',
    ));
    $menu->addChild('Essence', array(
            'uri' => '#essence',
    ));
    $menu->addChild('Life', array(
            'uri' => '#life',
    ));
    $menu->addChild('The World', array(
            'uri' => '#whatis',
    ));
    $menu->addChild('Appendix', array(
            'uri' => '#appendix',
    ));

    return $menu;
}

if i add {'nav_type': 'stacked_tabs'} to the

{{ knp_menu_render('BattlemamonoMainBundle:Builder:settingSidebarMenu') }}

making:

{{ knp_menu_render('BattlemamonoMainBundle:Builder:settingSidebarMenu', {'nav_type': 'stacked_tabs'}) }}

it works.

please help with this.

Assetic compiler error when using lessphp

When using lessphp I get the following error when running assetic:dump
[InvalidArgumentException]
There is no "less" filter.

I found a workaround to solve this issue modifying Bc\Bundle\BootstrapBundle\DependencyInjection\Configuration::buildConfigTree

the line
->defaultValue('less')
to
->defaultValue('lessphp')

Combining help/help_block with append_input causes the help to be output twice

This may be my misinterpretation of the documentation, but when I use attr[help], or attr[help_block] combined with append_input, I get the following output:

Twig:

{{ form_label(form.name, 'Name') }}
{{ form_widget(form.name, {'form_type': 'horizontal', 'attr': {
    'help_block': 'Used to generate a reference',
    'append_input': '123'}
}) }}

Output HTML:

<label for="..." class="required">Name</label>
<div class="input-append">
    <input type="text" id="..." name="..." required="required" maxlength="5" pattern="[A-Za-z]+" help_block="Used to generate a reference" append_input="">
    <span class="help-block">Used in our stock reference</span>
    <span class="add-on">123</span>
</div>
<span class="help-block">Used to generate a reference</span>

The main issue is that help-block inside input-append breaks the display (a gap when using inline, add-on is forced onto a newline when using block).

Additionally, it seems to me that the extra attr's shouldn't be added as attributes on the input. Is this to do with the way Symfony forms are implemented?

I'll attempt to dig into this/make a patch later on - but please let me know if my usage here is wrong :)

form error messages not appearing in horizontal layout

Below is my form code. When I do this messages don't appear on the individual fields. If I take out horizontal formatting, they appear. They will also appear with error bubbling but not inline.

I'm running latest symfony 2.3.2.

<form class="form-horizontal" action="{{ path('organizationuser_update', { 'organization_user_id': entity.id, 'organization_id': organization.id }) }}" method="post" {{ form_enctype(edit_form) }}>
        <input type="hidden" name="_method" value="PUT" />
        {{ form_widget(edit_form, {'form_type': 'horizontal'}) }}
        <p>
            <button class="btn" type="submit">Save</button>
        </p>
    </form>

here is the form builder for permissions.

->add('permissions', null, array(
                                            'constraints' => array(
                                                new Count(array(

                                                                  'min' => 2,
                                                             )),
                                            ),
                                            'required'      => false,
                                            'multiple'      => true,
                                            'expanded'      => true,

                                       ))

Here is a screenshot. Stuff turns red but no messages.

screen shot 2013-07-20 at 11 01 33 am

No easy way to disable automatic compilation of bootstrap files

I am trying to use this bundle primarily for the templating customizations it provides for forms, menus, etc.

I want to manage which parts of bootstrap I import via import directives in my master less file rather than including the entirety of bootstrap.

The bundle is assuming I want it to compile bootstrap for me from a single file and does this during cache clear and assetic dump which causes errors because I have not told it where to find bootstrap (as it doesnt need to know, I am managing this myself).

Currently I have tricked the bundle into not compiling with the following configuration

assetic:
    assets:
        bootstrap_css: ~

but I still have to configure the lessphp filter even though I dont want bootstrap compiled for me

bc_bootstrap:
    less_filter: lessphp

Is there an easy way to stop this bundle from trying to compile bootstrap for me or some alternative approach that is recommended in this case?

Symfony dependancy in composer.json

Would be awesome if the composer.json had appropriate dependencies on symfony versions so the appropriate errors would pop up during a composer update.

If you have a list of symfony versions compatible with each tag I'd be happy to make the contribution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.