complex varible indices of smarty arrays
| From: | Abdul-Wahid Paterson | Date: | Wed, 29 Dec 2004 14:46:27 +0000 |
| Subject: | complex varible indices of smarty arrays | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12083@lists.php.net to get a copy of this message | ||
Hi,
I have a portion of a smarty template that looks something like (cut
to make short).....
{section name=carti loop=$cart}
{assign var="item_id" value=$cart[carti]->item_id}
blah blah
{if $incompats && $incompats.$item_id}<img src="/incompat.gif">{/if}
blah blah
{/section}
The code works fine, I am just wondering though if there is a way I
can specify the item_id without the {assign} statement but straight in
the {if} statement. I couldn't work out a syntax that was
acceptedable.
Note: $incompats is an associative array and $cart is an array of objects.
thanks,
Abdul-Wahid