Skip to content

Instantly share code, notes, and snippets.

@ajaypatelbardoli
Created October 10, 2014 16:05
Show Gist options
  • Save ajaypatelbardoli/18ef99a3d0bd1198debc to your computer and use it in GitHub Desktop.
Save ajaypatelbardoli/18ef99a3d0bd1198debc to your computer and use it in GitHub Desktop.
ProfileFormType Class
<?php
namespace XXXX\Bundle\UserBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ProfileFormType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('firstName','text');
$builder->add('lastName','text');
$builder->add('zipcode','text');
$builder->add('phoneNo1','text');
$builder->add('phoneNo2','text');
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'XXXX\Bundle\UserBundle\Entity\Profile'
));
}
public function getName()
{
return 'xxx_user_profile';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment