
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 0.75 KB | hits: 12 | expires: Never
FosUserbundle and symfony 2 template and edits
services:
my_user.profile.form.type:
class: MyUserBundleFormTypeProfileFormType
arguments: [%fos_user.model.user.class%]
tags:
- { name: form.type, alias: my_user_profile }
fos_user:
profile:
form:
type: my_user_profile
<?php
namespace MyUserBundleFormType;
use SymfonyComponentFormFormBuilder;
use FOSUserBundleFormTypeProfileFormType as BaseType;
class ProfileFormType extends BaseType
{
public function getName()
{
return 'my_user_profile';
}
protected function buildUserForm(FormBuilder $builder, array $options)
{
$builder
->add('email', 'email')
->add('firstName')
->add('lastName')
;
}
}