Re: [SMARTY] if else and elseif statements...
| From: | Ben | Date: | Sat, 03 May 2003 10:24:48 +0000 |
| Subject: | Re: [SMARTY] if else and elseif statements... | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9462@lists.php.net to get a copy of this message | ||
why don't you code your statements easier:
{if ($member[members_show].AreaCode2) && (
$member[members_show].Exchange2 ) && ( $member[members_show].Number2 ) }
show what you want here
{/if}
so you just need this single if cause if these vars are empty smarty won't
do the if.
hope that helps you?
Ben
>had a quick question about if else and elsif tags...
>
>in the display for my web pages i need to see if a var is empty and if so
>show nothing at all otherwise if it is full then show its content.. so
>could i do something like this:
>{if $member[members_show].AreaCode2 == ""&&
>$member[members_show].Exchange2 == "" && $member[members_show].Number2 ==
>""}
>{else}
>({$member[members_show].AreaCode2}){$member[members_show].Exchange2}-$member[members_show].Number2}<br>
>{/if}
>...
>output should be something like this:
>(if empty show nothing..not even a table row for that set)
>
>otherwise if all 3 vars are full get output something like this:
>(123)456-7890
>
>should that work?
>
>
>
>---
>__________________________________________________________
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.476 / Virus Database: 273 - Release Date: 24.04.2003
___________________________________________________________________________
ICQ: 30595778
web: http://www.doubleBnet.de
http://www.disco-lifter.de
(Mitfahrgelegenheit für
Discos und Clubs)
http://gbuch.get-digital.de (Hol Dir
Dein kostenloses
Gästebuch)