Advertisement
Guest User

contactType

a guest
May 9th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2.  
  3.   namespace piano\PageBundle\Form;
  4.  
  5.   use Symfony\Component\Form\AbstractType;
  6.   use Symfony\Component\Form\FormBuilderInterface;
  7.   use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  8.  
  9.   class ContactType extends AbstractType
  10.   {
  11.     public function buildForm(FormBuilderInterface $builder, array $options)
  12.     {
  13.       $builder
  14.         ->add('name', 'text')
  15.         ->add('email', 'email')
  16.         ->add('subject', 'text')
  17.         ->add('message', 'textarea');
  18.     }
  19.  
  20.     public function setDefaultOptions(OptionsResolverInterface $resolver)
  21.     {
  22.       $resolver->setDefaults(array(
  23.           'data_class' => 'piano\PageBundle\Entity\Contact'
  24.         )
  25.       );
  26.     }
  27.  
  28.     public function getName()
  29.     {
  30.       return 'contact';
  31.     }
  32.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement