与字符串相比
我在树枝中有两个字符串变量,可以像这样正确打印,
{{ currpage }} , {{ field.value }}
但是我无法在“如果”中比较它们。 尝试{%if(currpage == field.value)%}
,{%if(field.value)%}
,{%if(if(currpage)与field.value)%}
相同,但是如果未执行,则代码。 但是,如果我在第一部分中的值进行了硬码,例如{%if(field.value中的'blabla')%}
它起作用。 我应该如何比较Opencart的树枝中的两个变量?
I have two string variables in twig that i can print properly like
{{ currpage }} , {{ field.value }}
But i can't compare them in an "if".
Tried {% if (currpage == field.value) %}
, {% if (currpage in field.value) %}
, {% if (currpage same as field.value) %}
but the code after if is not executed.
However if i hardcode a value in the first part like {% if ('blabla' in field.value) %}
it works.
How should i compare two variables in twig in opencart?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论