Skip to content

Instantly share code, notes, and snippets.

@michaelcullum
Created April 7, 2016 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelcullum/26d15cf21c8fa4e44c7faf20b9d8aaa6 to your computer and use it in GitHub Desktop.
Save michaelcullum/26d15cf21c8fa4e44c7faf20b9d8aaa6 to your computer and use it in GitHub Desktop.
<?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