On 28.11.2010, at 00:17, Lukas Kahwe Smith wrote:
> {% block field %}
> <li {% if field.hasErrors %} class="form_error" {% endif %}>
> {{ field|render_label }}
> {{ field|render_errors }}
> {% if field.hasErrors %}
> {{ field|render_widget(['class':'form_error']) }}
> {% else %}
> {{ field|render_widget }}
> {% endif %}
> </li>
> {% endblock field %}
>
> It seems however that "group" is now "field_group" and "field" has been split
> up into separate blocks. Now I am wondering how I can get a <li> around each
> field? Do I have to overwrite every single block? Aka text_field, *_field ..?
> Same applies to how do I add the form_error class in case of an error?
I guess for errors I could do the following:
{% block field_attributes %}
id="{{ field.id }}" name="{{ field.name }}"{% if field.disabled %}
disabled="disabled"{% endif %}{% if field.hasErrors %} class="form_error" {%
endif %}
{% display attributes %}
{% endblock field_attributes %}
Of course that could get be into trouble if {% display attributes %} contains a
class attribute.
regards,
Lukas Kahwe Smith
[email protected]
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en