Re: if in section

From: Date: Mon, 19 Feb 2001 14:55:58 +0000
Subject: Re: if in section
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-144@lists.php.net to get a copy of this message
absolutely! be sure to use the correct syntax though, in your example it looks as if you should use a slash instead of a period. All three of these examples should work identical, it is just a matter of your syntax preference: {if ($service/b_active == 1)} {if $service/b_active == 1} {if $service/b_active eq 1} Alexei Saveliev wrote: > > Hello All! > > I'm trying to migrate to Smarty so I need to clarify some things. > Is it possible to reference section looped variables in {if}? > For example (ideal situation) > > {if is_array($c_name)} > Table header > {section name=service loop=$c_name} > {if ($service.b_active==1)} > Active format applied {$service/b_active} {$service/c_name} > {else} > Inactive format applied {$service/b_active} {$service/c_name} > {/if} > {/section} > {else} > Empty table > {/if} > > -- With best regards, Alexei >

« previous php.smarty.general (#144) next »