I'd like to use Uploadable to save some images (i.e. profile picture for users). I'm using many other Doctrine Extensions already (softdeletable, timestampable, blameable, etc.) so I thought it would be nice to use this one as well.
However, I don't know how to set up my Forms. The StofDoctrineExtensionsBundle documentation gives this example:
$document = new Document();
$form = $this->createFormBuilder($document)
->add('name')
->add('myFile')
->getForm()
;
//(...)
$uploadableManager->markEntityToUpload($document, $document->getMyFile());
In this example, is name
the name of the Document or the name of the file?
Atlantic18/DoctrineExtensions's documentation adds a path
, name
, mimeType
and size
to an entity, to there is no myFile
attribute.
Can anybody explain how to set up a Form for a Uploadable Doctrine entity? I couldn't find any documentation or good example that helped me further.