Created
April 7, 2016 13:45
-
-
Save michaelcullum/26d15cf21c8fa4e44c7faf20b9d8aaa6 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 AppBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\Form\Extension\Core\Type\{TextType, DateType, IntegerType, CheckboxType}; | |
use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |
class FoobarType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('name', TextType::class) | |
->add('another', CheckboxType::class) | |
->add('int', IntegerType::class) | |
->add('bar', DateType::class) | |
->add('foo', EntityType::class, [ | |
'class' => 'AppBundle:Foo', | |
]) | |
; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment