Smarty PHP 条件帮助
当 $SENDER_LAST_WORD_PLAYED
或 $SENDER_LAST_WORD_SCORE
为空时,我希望不打印“播放的第一个单词:$SENDER_LAST_WORD_PLAYED for $SENDER_LAST_WORD_SCORE 点”的句子。到目前为止,我已经编写了它,只有当 $SENDER_LAST_WORD_PLAYED
不存在时,它才不会打印该句子,但我还想对其进行 $SENDER_LAST_WORD_SCORE
验证。
这是我现在的代码:
{if isset($SENDER_LAST_WORD_PLAYED) && !empty($SENDER_LAST_WORD_PLAYED)}
First word played: '{$SENDER_LAST_WORD_PLAYED|truncate:15:"..."|capitalize}' for %%SENDER_LAST_WORD_SCORE%% points
{else} {/if}
有什么想法吗?
When $SENDER_LAST_WORD_PLAYED
or $SENDER_LAST_WORD_SCORE
are blank I want the sentence stating "First word played: $SENDER_LAST_WORD_PLAYED for $SENDER_LAST_WORD_SCORE points" to not be printed. So far I've written it so that only if $SENDER_LAST_WORD_PLAYED
is not present it will not print the sentence but i would also like to put $SENDER_LAST_WORD_SCORE
validation on it.
Here's my code right now:
{if isset($SENDER_LAST_WORD_PLAYED) && !empty($SENDER_LAST_WORD_PLAYED)}
First word played: '{$SENDER_LAST_WORD_PLAYED|truncate:15:"..."|capitalize}' for %%SENDER_LAST_WORD_SCORE%% points
{else} {/if}
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑另一个镜头:
EDIT Another shot: