TwitterBootstrapBundle icon indicating copy to clipboard operation
TwitterBootstrapBundle copied to clipboard

Integrating Boostrap Form

Open fabiofabbrucci opened this issue 13 years ago • 8 comments

Hi, Adding your bootstrav2_html.twig i got an error. "Variable "translation_domain" does not exist in RuianTwitterBootstrapBundle:Form:bootstrap_v2.html.twig at line 33"

Where and how should i set that variable?

Thank you very much.

fabiofabbrucci avatar Feb 01 '12 17:02 fabiofabbrucci

Do you use the latest symfony2 build ? I'm looking if in previous version it was different.

ruian avatar Feb 01 '12 18:02 ruian

Im using the 2.0.9.

fabiofabbrucci avatar Feb 01 '12 18:02 fabiofabbrucci

Ok i see the problem, it's because i work with the latest version of sf 2.1.x. I will make a branch for 2.0.x symfony version. And it will resolve your issue.

ruian avatar Feb 01 '12 18:02 ruian

So i create a branch 2.0.x

who change

{% block generic_label %}
{% set attr = attr|merge({'class': ''}) %}
{% spaceless %}
    {% if required %}
        {% set attr = attr|merge({'class': 'required'}) %}
    {% endif %}
    <label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
{% endspaceless %}
{% endblock %}

to

{% block generic_label %}
{% set attr = attr|merge({'class': ''}) %}
{% spaceless %}
    {% if required %}
        {% set attr = attr|merge({'class': 'required'}) %}
    {% endif %}
    <label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans }}</label>
{% endspaceless %}
{% endblock %}

Test it and reply me if it resolve your problem :-)

ruian avatar Feb 01 '12 18:02 ruian

Thanks! Seems to have fixed it for me :-)

applestump avatar Feb 22 '12 23:02 applestump

@ruian , could you cherrypick my fixes for js order and images to 2.0.x branch? I'm on standart symfony and have the same problems too )

andrewtch avatar Feb 26 '12 19:02 andrewtch

It's done ;-) https://github.com/ruian/TwitterBootstrapBundle/commit/11baa5d6c2eea9cbec0ae05e73f8ba8b6b84350d

ruian avatar Feb 26 '12 19:02 ruian

It seems like this issue was fixed?

#closerequest

Blackskyliner avatar Dec 14 '12 09:12 Blackskyliner