1

i have an entity called User, and instead of filling the entity manually in easyadmin, i want to upload json file to fill the form automatically with available data,

Kareem Essawy
  • 565
  • 1
  • 4
  • 14

1 Answers1

1

Have you looked at the Serializer Component? This can serialize and deserialize entities to and from JSON amongst other formats.

https://symfony.com/doc/current/components/serializer.html

  • yes, but still dont have a clue how to upload a file and fill the form using the file json content – Kareem Essawy Jul 07 '17 at 13:55
  • It sounds like you need to create a form to upload the file, attach the file and deserialize on form submission. Try a combination of the Serializer guide I linked above, and the guide on file uploads here: https://symfony.com/doc/current/controller/upload_file.html – Steve Lewis Jul 07 '17 at 15:08
  • great, i will.. Thank you – Kareem Essawy Jul 07 '17 at 15:26