我的代码是这样写的,
{if $quant eq 1}
{if $val neq ""}
.....//some code
{else}
.....//some code
{/if}
{else if $quant eq 0}
.....//some code
{/if}但是上面嵌套的smarty if条件并没有像预期的那样工作,它总是在else condition.Can中给出结果任何人请帮助我,不知道我哪里搞错了……
发布于 2016-01-21 18:51:18
在smarty中,你必须像这样写if else条件:
{if $quant eq 1}
{elseif $val neq ""}
.....//some code
{elseif $val neq "3"}
.....//some code
{elseif $quant eq 0}
.....//some code
{/if}或
{if $quant eq 1}
{if $val neq ""}
.....//some code
{else}
.....//some code
{/if}
{else}
{if $quant eq 0}
.....//some code
{/if}
.....//some code
{/if}我希望这能对你有所帮助。
https://stackoverflow.com/questions/18527644
复制相似问题