树枝数学与变量

鲁比克斯

我想在树枝上做一些数学运算。我有2个变量,价格和数量,我想乘以它们。但是当我这样做时:

{{ {{ carts.price }} * {{ carts.quantity }} }}

返回错误

A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "punctuation" of value "{".

我怎样才能做到这一点

r42

这是因为您重复了{},请尝试如下操作:{{ carts.price * carts.quantity }}

一些文档https://twig.symfony.com/doc/2.x/templates.html#math

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章