But then it is incredibly useful to be able to universally change the
markup of all of your form elements.. especially when prototyping. For
example, at the moment I do not know if I am going to use a table
layout or a CSS layout, so I am using the shortcuts, but the labels
look bad.
And besides, if I can get away with just using the form templating
system, then that would be my preference.
It would be quite neat if it were possible to set arbitary parameters
on a form form / field / group which can then be accessed from the
template, enabling the developer to do whatever they like e.g.
{% block form_row %}
<tr>
<th>{{ field.getAttribute('label') }}</th>
<td>{{ form_field(field) }}</td>
<td>{{ field.getAttribute('help') }}</th>
</tr>
{% endblock %}
Theoretically I dont see why most forms cannot be rendered entirely
using "form_field(form)", but I guess it depends on your use case. Why
is it considered bad practice?
Also in terms of reuseability and extensibility, its nice not to have
to re-type the same labels and help fields -- why repeat yourself? :)
On 20 January 2011 09:02, Bernhard Schussek <[email protected]> wrote:
> 2011/1/19 Dan Leech <[email protected]>:
>> Is it going to be possible to add Labels and Help to form fields in
>> the SF2 form framework?
>
> No. You have to write that into your template when manually rendering
> the form. Rendering a whole form automatically is discouraged.
>
> Bernhard
> --
> Software Architect & Engineer
> Blog: http://webmozarts.com
> Twitter: http://twitter.com/webmozart
>
>
>
> 2011/1/19 Dan Leech <[email protected]>:
>> Is it going to be possible to add Labels and Help to form fields in
>> the SF2 form framework?
>>
>> This would be great for auto-rendering forms and field_rows and would
>> really enable us to leverage
>> the power of the form templating system.
>>
>> Incidentally, at the moment my prototype forms look rather messy as I
>> use camel-cased property names and
>> I think the form framework "humanizes" only under_scored properties,
>> but that doesn't follow convention does it? (?)
>>
>> --
>> Dan Leech
>>
>> Web Developer
>> www.dantleech.com
>>
>> --
>> 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
>>
>
> --
> 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
>
--
Dan Leech
Web Developer
www.dantleech.com
--
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