1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
namespace Sensio\HelloBundle\Contact;
// src/Sensio/HelloBundle/Contact/ContactForm.php
use Symfony\Component\Form\Form;
use Symfony\Component\Form\TextField;
use Symfony\Component\Form\TextareaField;
//use Symfony\Component\Form\EmailField;
use Symfony\Component\Form\CheckboxField;
class ContactForm extends Form
{
protected function configure()
{
$this->add(new TextField('subject', array(
'max_length' => 100,
'required' => true,
)));
$this->add(new TextareaField('message', array(
'required' => true,
)));
$this->add(new TextField('sender'));
$this->add(new CheckboxField('ccmyself', array(
'required' => false,
)));
}
} |