Created
July 16, 2016 13:04
-
-
Save pboethig/fb4834d7f994c837c0ed781200367aa0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Check\BlogBundle\Form; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
use Symfony\Component\Form\Extension\Core\Type\EmailType; | |
class UserType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('username') | |
->add('email', EmailType::class,array('empty_data' => null)) | |
->add('password') | |
->add('firstname') | |
->add('lastname') | |
; | |
} | |
public function setDefaultOptions(OptionsResolverInterface $resolver) | |
{ | |
$resolver->setDefaults(array( | |
'data_class' => 'Check\BlogBundle\Entity\User' | |
)); | |
} | |
public function getBlockPrefix() | |
{ | |
return 'check_blogbundle_user'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment