Hi Bernhard,

At 12:03 16/12/2008, Bernhard Schussek wrote:
>First of all you need to understand that
>
>     <?php echo $form ?>
>
>was never meant to replace custom styling. If you want to customize
>the structure, CSS classes or other attributes of the generated HTML,
>you need to do it manually in the template.

Indeed, and I am doing this already (I have a custom template for my 
form). However, applying a CSS class to fields with errors shouldn't 
be controlled manually in the template - sure the class name is a 
presentation-level item, but checking if it should be assigned to a 
form field isn't. That's bringing in too much logic.

>symfony 1.2:
>
>     <ul>
>     <?php foreach ($form as $field): ?>

Ah, I hadn't twigged that I could loop over the form to get the 
fields - I was wondering how I could do it without adding:
<?php echo $form['field1']->renderError()?>
<?php echo $form['field2']->renderError()?>

etc...

Regards,
Peter

-- 
Maple Design Ltd - Web design and application development
http://www.mapledesign.co.uk
+44 (0)845 123 8008

Reg. in England no. 05920531 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to