+1 for this. it would seem to make decorating specific rows differently
much easier. i don't see the flexibility in Nicolas' suggestion of using
a schema to easily do this. plus, it's intuitive, and a nice alternative
to echo $form (disclaimer: i've only read about the new forms, still
using sf 1.0, so perhaps this per-row markup alteration is very easy via
a custom schema as Nicolas suggested. i'd be happy to be proven wrong
on this!)
cheers,
-eric
Marijn wrote:
> Hi everybody,
>
> I posted this two days ago in the symfony-user (http://
> groups.google.com/group/symfony-users/browse_thread/thread/
> a58af75b938d946a/e4184d11732ac823#e4184d11732ac823) list but I think I
> should have posted it here...
>
> I have been playing around with the new form framework and since I
> moved past my initial thought (that it seemed to complicated for stuff
> that ought to be easy) I'm pretty much in love with it. I have a small
> request though: if you create a form where the fields should be
> decorated with all sorts of extensive markup it is nice to be able to
> simply loop over all the form fields like this:
>
> [example]
> <?php foreach ($form as $formField): ?>
> <div class='form_field'>
> <div class='some_class_name'>
> <?php echo $formField->renderLabel(), "\n"; ?>
> </div>
> <?php if ($formField->hasError()): ?>
> <div class='errors'>
> <?php echo $formField->renderError(), "\n"; ?>
> </div>
> <?php endif; ?>
> <?php echo $formField->render(array('class' => 'pretty')), "\n"; ?
> </div>
> <?php endforeach; ?>
> [/example]
>
> This way you keep the template files small and applying changes is
> quite easy.
>
> What are your thoughts on this?
>
> Marijn
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---