Symfony2 - 设置 ChoiceType 的标签

Symfony2 - Set label of ChoiceType

我在自动填充的表单中有一个 select 字段 (choiceType)(所有行都在另一个 table 中)。

我要设置标签(只有标签,没有select的内容)...

我设法通过更改 textType 做到了这一点:

$builder->add('note')

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

但我无法使用 choiceType 来做到这一点,因为如果我更改

$buidler->add('column')

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

select 未填写...

解决方法是:

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