How to configure VichUploader in entity mapped by yml?

穿精又带淫゛_ 提交于 2019-12-05 19:15:38

If you read the documentation carefully, you'll notice that the upload-related configuration isn't mixed with doctrine's entity declaration.

You need to create a src/Acme/DemoBundle/Resource/config/vich_uploader/Magazine.yml file with the following content:

Acme\DemoBundle\Entity\Magazine:
    file:
        mapping: magazine_cover
        filename_property: cover

You will find working code samples in my sandbox application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!