Development

Forms (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of Forms

Show
Ignore:
Author:
jablko (IP: 216.113.200.202)
Timestamp:
12/18/08 22:20:24 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Forms

    v0 v1  
     1=== Fieldset === 
     2 
     3It is sometimes useful to group fields in a long form into HTML fieldsets. Some fieldsets may be rendered collapsed and expandable. 
     4 
     5After reading [http://www.symfony-project.org/book/forms/1_2/en/03-Forms-for-web-Designers#Interacting%20with%20the%20Developer forms for web designers], I understand that one of the features of the symfony forms system is strong separation between form development and form design. I suspect that fieldsets are on the design side, so the correct way to add fieldsets to a symfony form is: 
     6 
     7{{{ 
     8<?php echo $form->renderFormTag(url_for(array('module' => 'contact'))) ?> 
     9  <fieldset class="collapsible collapsed"> 
     10    <legend>Foo</legend> 
     11    <?php echo $form['name']->renderRow() ?> 
     12    <?php echo $form['email']->renderRow() ?> 
     13  </fieldset> 
     14  <fieldset> 
     15    <legend>Bar</legend> 
     16    <?php echo $form['subject']->renderRow() ?> 
     17    <?php echo $form['message']->renderRow() ?> 
     18  </fieldset> 
     19  <input class="form-submit" type="submit" /> 
     20</form> 
     21}}}