Symfony 不显示约束冲突消息

Symfony 不显示约束冲突消息,symfony,constraints,symfony4,Symfony,Constraints,Symfony4,我正在尝试一种上传多个文件的方法 我在buildForm方法中添加了一个约束,以允许某些类型的文件。但是,当文件类型不好时,{{form_errors(form.documents)}不会显示错误消息 这是我的表格: 票证类型: TicketDocumentType: 经过一些研究,我发现我可以使用'error\u bubbling'=>true和{form\u errors(form)} 但是,我只希望有form.documents错误。这可能吗?应该是直接针对文档的情况: {{form_er

我正在尝试一种上传多个文件的方法

我在buildForm方法中添加了一个约束,以允许某些类型的文件。但是,当文件类型不好时,
{{form_errors(form.documents)}
不会显示错误消息

这是我的表格:

票证类型: TicketDocumentType: 经过一些研究,我发现我可以使用
'error\u bubbling'=>true
{form\u errors(form)}


但是,我只希望有form.documents错误。这可能吗?

应该是直接针对文档的情况:

{{form_errors(form.documents)}

有关更多信息,请参见此处:

->add('documents', CollectionType::class, array(
            'entry_type'        => TicketDocumentType::class,
            'prototype'         => true,
            'allow_add'         => true,
            'allow_delete'      => true,
            'by_reference'      => false,
            'required'          => false,
            'label'             => false,
        ))
->add('file', FileType::class, array(
                'label'     => false,
                'required'  => true,
                'constraints' => [
                    new File([
                        'maxSize' => '400k',
                        'mimeTypes' => [
                            "image/png",
                            "image/jpeg",
                            "image/jpg",
                            "image/gif",
                            "image/x-citrix-jpeg",
                            "image/x-citrix-png",
                            "image/x-png",
                            "application/pdf",
                            "application/x-pdf",
                            "application/vnd.ms-excel",
                            "application/msword",
                            "text/plain",
                            "application/zip"
                        ],
                        'mimeTypesMessage' => 'Les formats autorisés sont PDF, TXT, DOC, XLS, JPG, PNG, GIF, ZIP',
                    ])
                ]
            ));