Re: [SMARTY-GENERAL] If statements

From: Date: Mon, 01 Apr 2002 18:52:10 +0000
Subject: Re: [SMARTY-GENERAL] If statements
References: 1 2 3 4  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3422@lists.php.net to get a copy of this message
Is it any different when using a foreach? We've changed the left/right delimiters to be a square bracket. [foreach item=SECTION from=$SECTIONS] [if $SECTIONS[SECTION].IS_SECTION eq "Y"] This is a section [/if] [/foreach] Parse error: parse error, expecting `']'' in /var/www/virtuals/youreshop/dev/2002-smarty/hp/templates_c/50/5088fd25b0c0af 451d7b67edd1bcedde/d41d8cd98f00b204e9800998ecf8427e.php on line 43 Thanks, Brad Atkins Manager, Technical Development Sales: 1-877-973-2278 Support: 1-877-973-4968 Email: brad@youreshop.com ----- Original Message ----- From: "Andrei Zmievski" <andrei@ispi.net> To: "Brad Atkins" <brad@youreshop.com> Cc: <smarty-general@lists.php.net> Sent: Monday, April 01, 2002 1:36 PM Subject: Re: [SMARTY-GENERAL] If statements > On Mon, 01 Apr 2002, Brad Atkins wrote: > > Hey Monte, > > > > We do the following > > > > $tplassigns[] = array( > > 'ID' => $RESULT24->fields['SECTID24'], > > 'CATEGORY_ID' => "", > > 'NAME' => $NAME, > > 'IS_SECTION' => "Y" ); > > > > $tpl->assign( 'SECTIONS', $tplassigns ); > > > > So how would I reference that, IS_SECTION? > > > > {if $SECTION.IS_SECTION eq "Y"} > > {section name=foo loop=$SECTIONS} > > {if $SECTIONS[foo].IS_SECTION eq "Y"} > {/if} > > {/section} > > -Andrei > > "You choose to do the bad things in your life; > the good ones come and drag you along with them." > - Michael Marshall Smith >

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