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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <?php
namespace MyCompany\MyBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class RegistrationType extends AbstractType
{
/**
* Construit le Form
* @param FormBuilder $builder
* @param array $options
* @return void
*/
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('fullname', 'text', array ('label' => 'registration.fullnameLabel'))
->add('email', 'text', array ('label' => 'registration.emailLabel'))
->add('phoneNumber', 'text', array ('label' => 'registration.telephoneLable'))
->add('password', 'password', array ('label' => 'registration.passwordLabel'))
->add('passwordConfirm', 'password', array ('label' => 'registration.confirmPasswordLable'))
->add('newsletter', 'checkbox', array (
'required' => false,
'label' => 'registration.newsletter',
)
)
->add('partnerMail', 'checkbox', array (
'required' => false,
'label' => 'registration.partnerMail',
)
)
->add('termsAndConditionApproval1', 'checkbox');
}
/**
* Returns the name of this type.
* @return string The name of this type
*/
public function getName()
{
return 'form_registration';
}
} |
Partager