Sections and checkboxes
| From: | Erich Beyrent | Date: | Thu, 16 Dec 2004 14:58:47 +0000 |
| Subject: | Sections and checkboxes | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12047@lists.php.net to get a copy of this message | ||
Hi all,
I have two arrays that get assigned to my template - one containing
platforms, the other containing supported platforms. I am trying to loop
through both arrays and check the supported platforms.
{section name=i loop=$Platforms}
{section name=j loop=$SupportedPlatforms}
{if $SupportedPlatforms[j].platformName == $Platforms[i].platformName}
{$Platforms[i].platformName}
<input type=checkbox value="{$Platforms[i].platformID"
name="Platforms[]" checked>
{else}
<input type=checkbox value="{$Platforms[i].platformID"
name="Platforms[]">
{/if}
{/section}
{/section}
This works, but displays two checkboxes for supported platforms. Is there a
way to break out of the section loop, or is there perhaps a better/easier
way to accomplish my task?
Best regards,
Erich Beyrent
Systems Administrator
Information Technology Services
Plymouth State University
"Si vis pacem para bellum"