Could not load type “file” in Symfony3

前端 未结 2 1435
自闭症患者
自闭症患者 2020-12-21 21:24

I am building form with multiple image upload and I can\'t find solution for problem that is mentioned in title. To help me with that I included VichUploaderBundle

R

2条回答
  •  轮回少年
    2020-12-21 22:07

    Here is how you should add it to your form:

    use Symfony\Component\Form\Extension\Core\Type\FileType;
    
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
         $builder->add('image', FileType::class);
    }
    

    In Symfony 3 a form type is always passed by its fully qualified class name

提交回复
热议问题