dongyu2047 2012-09-12 09:52
浏览 30
已采纳

从Symfony2中的目录检索图像到视图

I have followed the upload tutorial provided in symfony2 cookbook and my question is now how to retrieve the file and to correspond to the records in the database...Thanks

  • 写回答

2条回答 默认 最新

  • dongqi7631 2012-09-12 11:17
    关注

    If you followed this tutorial, you will notice that your object has a getWebPath() function. You can use this function to get a path that you can use on your web site to create a link to this document. For example, in twig:

    <a href="{{document.getWebPath()}}">Document</a>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?