关于从symfony2.8到symfony3.x的更新过程,我有一个小问题。我有很多不推荐的警告,在开始更新之前,我想修复这些警告。
但是我无法修复它,因为在2.8版中似乎没有一些(新的)特性。可能是吗?
例如:
Accessing type "text" by its string name is deprecated since Symfony 2.8 and will be removed in 3.0. Use the fully-qualified type class name "Symfony\Component\Form\Extension\Core\Type\TextType" instead. (3 times) Show stack trace这意味着,我应该从以下方面定制我的表单:
->add('birthyear', 'text', array(
'label' => 'Year of birth',
'attr' => array('placeholder'=>'yyyy'),
'required' => false,
))为了..。
->add('birthyear', Symfony\Component\Form\Extension\Core\Type\TextType:class, array(
'label' => 'Year of birth',
'attr' => array('placeholder'=>'yyyy'),
'required' => false,
))但此文件夹路径在我的当前版本中不存在。
Symfony\Component\Form\Extension\Core\Type\TextType
我应该在更新后修复它吗?或者我该做什么解决办法?我很困惑,因为在Symfony文档中写着“您应该先修复它”。
谢谢你的反馈!
发布于 2018-04-05 14:32:48
use Symfony\Component\Form\Extension\Core\Type\TextType;
->add('birthyear', TextType::class, array(
'label' => 'Year of birth',
'attr' => array('placeholder'=>'yyyy'),
'required' => false,
))https://stackoverflow.com/questions/49674775
复制相似问题