Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 syomfony2 和资产。如何在我的网络文件夹中创建指向 pdf 文件的链接?
它适用于图像,但没有用于 pdf 的标签
{% image '@myBundle/Resources/public/pdf/dok.pdf'%} <img src="{{ asset_url }}" alt="my image"/> {% endimage %}
我想做的是一个简单的<a href...>Download pdf here</a>
<a href...>Download pdf here</a>
<a href="{{ asset('bundles/my/Resources/public/pdf/dok.pdf') }}">Download PDF!</a> 您不需要为此使用资产,它在下载 PDF 的上下文中没有任何意义。
<a href="{{ asset('bundles/my/Resources/public/pdf/dok.pdf') }}">Download PDF!</a>