Hi Everybody,

Today I was creating a form with the new form framework, which is
really a joy once you're past understanding its approach :-D It left
me to wonder if it would be a nice addition if sfForm implemented the
arrayitterator interface so you could loop over form fields to create
the templates...

[example]
<?php foreach ($form as $formField): ?>
  <div class='form_field'>
    <div class='bar_small_txt'>
      <?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]

I think this allows for easily decoration of the different fields AND
nice small template files.

I haven't played around a lot with the new Form Framework so maybe I'm
overlooking something..

Marijn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to