For forms, i'm using Uni-Form (http://sprawsm.com/uni-form/) as a markup template for a long time. It's most semantically right & customizable approach, that i've seen. Give it a try...
On Thu, Oct 21, 2010 at 18:02, Jordi Boggiano <[email protected]> wrote: > Heya, > > Just sending this to see if anyone thinks I'm wrong, but hopefully we > can all agree. > > I was working on converting the DoctrineUserBundle to Twig and trying to > make it more extensible and it turned out that there really is no sane > way to render the entire form based on the form templates > (form.twig/widgets.twig). > > Ultimately what I ended up with to keep flexibility was the following: > > <form action="{% route 'doctrine_user_session_create' %}" method="POST" > class="doctrine_user_user_new"> > <ul> > {% for field in form.getVisibleFieldsRecursively() %} > {{ field|render }} > {% endfor %} > <li> > <input type="submit" value="Login" /> > </li> > </ul> > {{ form|render_hidden }} > </form> > > As you can see it renders the field with the form.tpl "field" block, so > at least you can override that on a per-project basis to have it fit > your need, but I still have to put a <ul> and <li> to have the submit > input be part of the ul. We could argue whether that's a good idea or > not though. > > But the thing is, the default templates are using table tags to create > the form group instead of ul, and I think that's pretty wrong > semantically speaking. ul/li is enough to style the form and if you want > you're still able to completely override the bundle's template with your > own if the style doesn't match yours, but I think we should provide > defaults templates that are fitting the best practices for the bundle > developers, so that everything works together by default. > > See pull request at http://github.com/fabpot/symfony/pull/100 > > Cheers > > -- > Jordi Boggiano > @seldaek :: http://seld.be/ > > -- > 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]<symfony-devs%[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
