【发布时间】:2016-07-21 11:08:05
【问题描述】:
我们目前正在将 symfony 2.7 项目更新到 3.*,并且我们即将在 2.8 版本中清除弃用。
所以我不断收到弃用通知
Passing type instances to FormBuilder::add(), Form::add() or the FormFactory is deprecated since version 2.8 and will not be supported in 3.0. Use the fully-qualified type class name instead (******\AutoBundle\Form\Type\ChoiceNVType)
ChoiceNVType 是我们目前使用的自定义类型,如下所示:
$form->add('model', new ChoiceNVType(), array(
'choices' => array(),
'required' => false,
'placeholder' => 'Something',
));
现在我们要修复所有弃用通知,但我不知道如何使用自定义类型来解决。有什么想法吗?
【问题讨论】: