【发布时间】:2016-09-25 11:40:39
【问题描述】:
我有一个 Sylius 实例,其翻译文件已配置且工作正常
现在只需在我的twig 中使用这样的 sn-p:
{{ 'project.sylius.frontend.header.label'|trans }}
它从yaml 翻译文件中检索正确的字符串:
project.sylius.frontend.header.title: Welcome here
我想知道的是,如果有机会将带有插值标记的字符串直接存储在yaml中,
像这样:
project.sylius.frontend.cart_number: you are going to buy %n candies
project.sylius.frontend.delivery: delivery will be between the %whatever and %whatever
以及如何在twig文件中传递变量
【问题讨论】:
标签: symfony twig translation sylius