I use the bundle KnpLabs/DoctrineBehaviors (translatable) for to manage my translation.
I use also the bundle vichuploadbundle to manage my img.
I have an entity that must have different images depending on languages, so I placed my img field and the annotation Vich\UploadField in my entityTranslatable entity. But I can't display the image on Twig... I have this error :
This is my twig code :
{{ vich_uploader_asset(creation, 'imageCreation ') }}
And this, my entity code :
/**
* @Vich\UploadableField(mapping="image_creation", fileNameProperty="image")
* @var File
*/
private $imageCreation;
EDIT:
it's ok for my first problem. But now I have an error because the mapping of my image field is not found... How mapping this ? Because my image field is'nt in my Creation entity but in my CreationTranslation entity ?
Thanks you in advance
Follow the documentation https://github.com/dustin10/VichUploaderBundle/blob/master/Resources/doc/usage.md :
/**
* @ORM\Entity
* @Vich\Uploadable
*/
class Creation
{
}