symfony - Convert photo name to photo url -


i have place entity uploadable photo :

 /**  * @orm\column(type="string", length=255)  * @var string  * @apiproperty(iri="http://schema.org/photo")  * @groups({"read"})  */ private $photo;   /**  * @vich\uploadablefield(mapping="image", filenameproperty="photo")  * @var file  * @assert\notblank()  * @assert\file(  *     maxsize = "1024k",  * )  */ private $photofile; 

when request api photo name of entity, want photo url (absolute url) exploit directly in angular application. vich uploader has helper retrieve path of photo can't directly in method getphoto(), how can ?

you add event subscriber that, listening on get /places if there photofile, computing helper , populate non-persisted field called photourl.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -