Skip to content

Instantly share code, notes, and snippets.

@codecowboy
Created July 12, 2011 20:11
Show Gist options
  • Save codecowboy/1078865 to your computer and use it in GitHub Desktop.
Save codecowboy/1078865 to your computer and use it in GitHub Desktop.
ProfileFormType
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Gymloop\CoreBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class ProfileFormType extends \FOS\UserBundle\Form\Type\ProfileFormType
{
public function buildUserForm(FormBuilder $builder, array $options)
{
$builder
->add('first_name')
->add('last_name')
->add('username')
->add('email')
//->add('plainPassword', 'repeated', array('type' => 'password', 'options' => array('required' => false)))
//->add('programmes', new ProgrammeType());
->add('programmes', 'collection', array(
'type' => new ProgrammeType()));
}
public function getName()
{
return 'gymloop_profile_type';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment