Re: [SMARTY] Problem with Include File parameters inside Sections.

From: Date: Mon, 05 Jan 2004 17:04:30 +0000
Subject: Re: [SMARTY] Problem with Include File parameters inside Sections.
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10774@lists.php.net to get a copy of this message
see: http://smarty.php.net/manual/en/language.syntax.quotes.php On Mon, Jan 05, 2004 at 04:55:20PM +0000, Tom wrote: > I need to include a generic template with a varying URL as an argument > inside a section loop. > > {section name=item loop=$mylist} > <td> > {if $mylist[item].bin == 'yes'} > {include file = "/deleteIcon.tpl" > delUrl = > "/deleteMe.php?itemType=$mylist[item].type&itemClass=$mylist[item].class"} > {else} > {include file = "/deleteIcon.tpl" delUrl="javascript:alert('This > may not be deleted')"} > {/if} > </td> > {/section} > > The version above causes "$mylist[item].type" to become "Array.type" in > the URL generated. > > The delete icon is generic across the whole site and needs the URL > generated for it, and I have > tried using the dot notation ($mylist.item.type) and to try to get PHP > to understans it as one > variable (${mylist[item].type}) etc.. > > So I am obviously going about it all wrong :) > Can anyone help me to get this to work? > > Thanks

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