0
我一直在想,如果有可能添加参数为资产树枝功能这样在Symfony2的树枝资产功能
#config.yml
...
framework:
templating:
parameters:
key: value
OR
twig:
parameters:
key: value
...
而且在树枝文件使用资产这样
# twig file
<script src="{{ asset('/file/path', key) }}"></script>
添加参数
而且将重新
<script src="/file/path?key=value"></script>
我知道我可以创建一个宏,要做到这一点,但我想知道是否有一个另一种方式。
感谢您的回复
你知道了吗? – codecowboy
[如何在Symfony2 Twig模板中获取配置参数](https://stackoverflow.com/questions/6787895/how-to-get-config-parameters-in-symfony2-twig-templates) – Martijn