0xPunt
0xPunt

Reputation: 321

Symfony2 - Set label of ChoiceType

I have a select field (choiceType) in a form which is automatically filled (with all the line in another table).

I would like to set the label (only the label, not the content of the select)...

I managed to do that for a textType with changing :

$builder->add('note')

to

$builder->add('note', 'text', array('label' => 'myNewLabel')

but I can't do that with a choiceType because if I change

$buidler->add('column')

to

$builder->add('column', 'choice', array('label' => 'myNewLabel')

the select isn't filled...

Upvotes: 0

Views: 912

Answers (1)

0xPunt
0xPunt

Reputation: 321

The solution is :

$builder->add('column', null, array('label' => 'myNewLabel')

Upvotes: 1

Related Questions