相关疑难解决方法(0)

Symfony2:翻译消息中的HTML

messages.en.yml,我有

confirmed: Congrats %username%, your account is now activated.
Run Code Online (Sandbox Code Playgroud)

但我想用'粗体'用户名示例......我怎么能做到这一点?

confirmed: Congrats <span class='bold'>%username%</span>, your account is now activated.   
Run Code Online (Sandbox Code Playgroud)

当然我可以在这个例子中使用两个句子

first: Congrats
second: , your account ... 
Run Code Online (Sandbox Code Playgroud)

和twig内部使用html标签,但这看起来很脏.

symfony

29
推荐指数
3
解决办法
2万
查看次数

标签 统计

symfony ×1