我是 Symfony 的新手。如何在 twig 模板中使用 native php 函数?
例如,我想在这样的循环中使用函数 chr
:
{% for directory in directories %}
chr(loop.index)
{% endfor %}
最佳答案
Twig 允许您添加 functions和 filters . the documentation 上有多个示例.
例如,
关于php - 是否可以在 Twig 中使用 native php 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15413150/