Symfony Forms – Setting the Form Formatter

Submitted by:Pitter Alderson

Date added:21 July, 2011

Category:Symfony

By default Symfony displays forms in tables, with each new input being a table row. If you want to display your forms more semantically with fieldsets and lists, Symfony has a list formatter built in. You can tell an individual form to display as a list using the code below.

Tags: symfony forms

Code Snippet:

<?php
// lib/form/MyModelForm.class.php
public function configure() {
$this->widgetSchema->setFormFormatterName('list');
}
?>
 
 

Comments