Changing the global rendering of forms
So far, we have seen how forms are rendered globally, either as a table or an unordered list. Of course, the forms framework makes the global rendering of forms very easy to change and extend. To demonstrate this, we are going to create our own format. This new format will render the fields within the<div> tags.
To create our own form format, we need to create a new class that extends the sfWidgetFormSchemaFormatter class. The naming convention for the actual class that we will create needs to follow sfWidgetFormSchemaFormatterName. Therefore, our class will be called sfWidgetFormSchemaFormatterDiv.class.php. Because this class will need to be accessed globally, it must be placed in either the lib/ folder or in a subfolder within the lib/ directory. Create a new folder in the lib/ directory called widget, so that the path reflects lib/widget. In this folder, we are going to create our formatter class. Create a file named WidgetFormSchemaFormatterDiv...