0
심포니 2를 사용하여 매우 간단한 앱을 만들려고합니다.Symfony2 - FOS UserBundle - 데이터베이스의 데이터로 드롭 다운 목록으로 레지스터 양식 덮어 쓰기
FOS UserBundle을 HWI Oauth2와 함께 설치 및 구성했습니다.
잘 작동하지만 등록 양식을 수정하여 데이터베이스에있는 데이터가 포함 된 드롭 다운 목록이 doctrine에 의해 제거되도록하고 싶습니다.
Symfony doc에서 아무 것도 발견되지 않았습니다. .
누구든지 제안을 할 수 있습니까?
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))
->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle'))
**/**** This Works and give a dropdownlist but i want to get this list from database instead of hard coded data how can I achieve that ? *****/**
->add('status_type', 'choice', array(
'choices' => array(
'' => 'Please Select...',
'developper' => 'Android Developper',
'architect' => 'Android or Mobile Architect',
'mobile' => 'Mobile Developper',
'web and mobile' => 'Web and Mobile Developper',
)))
->add('plainPassword', 'repeated', array(
'attr' => array('class' => 'form-control'),
'type' => 'password',
'options' => array('translation_domain' => 'FOSUserBundle'),
'first_options' => array('label' => 'form.password'),
'second_options' => array('label' => 'form.password_confirmation'),
'invalid_message' => 'fos_user.password.mismatch',
))
;
}