开发者

Smarty PHP Conditional Help

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 开发者_C百科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?


EDIT Another shot:

{if isset($SENDER_LAST_WORD_PLAYED) && !empty($SENDER_LAST_WORD_PLAYED) && isset(SENDER_LAST_WORD_SCORE) && !empty(SENDER_LAST_WORD_SCORE)}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜