Cytat(umatik @ 7.12.2017, 10:03:55 )

W zasadzie mój problem opisuje temat. Jak mam dodać skutecznie dodatkowe pola w formularzu rejestracji
FOSUserBundle opisujące dodatkowe role np:
inputy standarowe:
- username
- email
- pass
- pass2
dodatkowe checkbox'y lub radio:
- role-wizard
- role-knight
- role-alien
User.php
...
const ROLE_WIZARD = 'ROLE_WIZARD';
const ROLE_KNIGHT = 'ROLE_KNIGHT';
const ROLE_ALIEN = 'ROLE_ALIEN';
const ROLE_TO_DISPLAY = [
self::ROLE_WIZARD => 'Wizard',
self::ROLE_KNIGHT => 'Knight',
self::ROLE_ALIEN => 'Alien',
];
public function getRole(): string
{
$roles = $this->getRoles();
}
public function setRole(?string $role): self
{
return $this->setRoles([$role]);
}
RegistrationFormType.php
...
$builder->add('role', ChoiceType::class, [
'multiple' => false,
'expanded' => true,
]);