Creating a simple form
We have seen how powerful forms in Symfony are, especially when bounded to a database table. Not all forms, though, will need to reference a database table. Instead, we can create a simple form for which the process is practically the same. The only difference is that we have to manually create the form class.
Just to give you an example, let's say we want to create a simple feedback form that contains three fields called name, email, and message. You would create the new form class at the same place where all of the other form classes are stored—in lib/form/—and perhaps, name the file as FeedbackForm.class.php. With this created, let's create the class as follows:
class FeedbackForm extends BaseForm
simple formname field{
public function configure()
{
$this->setWidgets(array(
'name' => new sfWidgetFormInput(),
'email' => new sfWidgetFormInput(),
'message' => new sfWidgetFormTextarea(),
));
//Add validation
$this->setValidators(array(
'name'=>...