Created
May 7, 2012 13:24
-
-
Save coreymcmahon/2627734 to your computer and use it in GitHub Desktop.
A UserType class used to implement a form for the User entity - http://www.symfonycentral.com/symfony-does-validation.html
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 MyCompany\BlogBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilder; | |
class UserType extends AbstractType | |
{ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('username') | |
->add('email') | |
->add('password', 'password') | |
; | |
} | |
public function getName() | |
{ | |
return 'mycompany_blogbundle_usertype'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment