Slide 37
Slide 37 text
Form Itself
class RegistrationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('username', 'text');
$builder->add('email', 'email');
$builder->add('password', 'repeated', [
'first_name' => 'password',
'second_name' => 'confirm',
'type' => 'password',
]);
$builder->add(
'terms',
'checkbox',
['property_path' => 'termsAccepted']
);
$builder->add('Sign Up!', 'submit');
}
public function getName()
{
return 'registration';
}
}