Closed
Description
On https://symfony.com/doc/current/controller/upload_file.html in the 4th code block it says:
// updates the 'brochure' property to store the PDF file name
// instead of its contents
$product->setBrochure($fileName);
But the "second part" is not documented: If the file is already present, you also have to do this before creating the form:
$product->setBrochure(new File($product->getFileName()));
So the general question is: Wouldn't it be better to recommend a Data Transformer instead of manually transforming back and forth in the controller?
This would (would it?) also solve this problem with EasyAdmin: EasyCorp/EasyAdminBundle#2356
Metadata
Metadata
Assignees
Labels
No labels