JMSTranslationBundle
JMSTranslationBundle copied to clipboard
FormType : @Ignore with choices
The @Ignore annotation does not work with choices
$form->add('status','choice', [
'choices' => [
1 => /** @Ignore */'Yes',
0 => /** @Ignore */'No'
],
'required' => false,
])
or
$form->add('status','choice', [
/** @Ignore */
'choices' => [
1 => 'Yes',
0 => 'No'
],
'required' => false,
])
or even
/** @Ignore */
$form->add('status','choice', [
'choices' => [
1 => 'Yes',
0 => 'No'
],
'required' => false,
])
i have the same issue
same issue
same for me
this worked for me:
$choices = array('choice 1', 'choice 2');
$builder->add('_choice', 'choice', array(
/** @Ignore */'choices' => $choices
));
I know it was a long time ago you posted this issue. Do you still experiencing this? Or is it fixed in the latest version of the bundle?
Unfortunately I can't answer you. I don't use JMSTranslationBundle anymore :disappointed:
But it could be easy to test. Just need to extract translations with the three cases above.
I've testet it now and the issue does still exist. This is only when I use the formBuilder in the controller.
I can confirm the same