我想在我的MyType表单locale字段中添加,所以我输入:
$builder->add('locale', 'locale', array(
'label' => 'user.locale',
'required' => true,
));
但是,它为我提供了可用语言环境的完整列表,因为choices这种类型的默认数组是:
'choices' => Intl::getLocaleBundle()->getLocaleNames()
我只想显示en,de和pl。如何将输出限制为这些语言?
最好的解决方案是在config.yml.