Twig:包含来自 SVG 文件的外部代码 [英] Twig: Include external Code from an SVG file
本文介绍了Twig:包含来自 SVG 文件的外部代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以将 svg 文件中的代码直接包含到 twig 模板文件中?
Is it possible to inlcude code from a svg file directly into a twig template file?
类似:
{% include 'my.svg' %}
这将导致:
<svg viewbox=".... />
推荐答案
一种方法:
{{ source('my.svg') }}
在这里阅读更多:https://www.theodo.fr/blog/2017/01/integrating-and-interacting-with-svg-image-files-using-twig/
这篇关于Twig:包含来自 SVG 文件的外部代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文