Created
June 3, 2012 00:51
-
-
Save ecoleman/2860764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\UserBundle\Form; | |
use My\ContactBundle\Form\BasicPersonType; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
class UserType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('username') | |
->add('email') | |
->add('person', new BasicPersonType()) | |
->add('plainPassword', 'repeated', [ | |
'type' => 'password', | |
'invalid_message' => 'The password fields must match', | |
'options' => [ | |
'required' => false, | |
], | |
'first_options' => ['label' => 'Password', 'required' => false], | |
'second_options' => ['label' => 'Confirm Password', 'required' => false] | |
]); | |
; | |
} | |
public function getDefaultOptions() | |
{ | |
return [ | |
'data_class' => 'My\UserBundle\Entity\User' | |
]; | |
} | |
public function getName() | |
{ | |
return 'my_userbundle_usertype'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment