Hi,
i have an associative array and i am trying to get the first record with smarty.
In php i use current(array), but smarty dont seems to have current.
So i wrote the code below
{if is_array($browseProducts.data) }
<ul class="products-grid">
{foreach from=$browseProducts.data item=item}
{assign var='image' value=''}
{if is_array($item.images) }
{php} $image=current($item.images); {/php}
{/if}
{/foreach}
</ul>
{/if}
in {php} section current($item.images) gives Warning: current() [function.current]: Passed variable is not an array or object
The syntax is right so i guess the $item.images from smarty can not be read by {php}
Any way to pass $item.images to {php} section, or what.
Any suggestion to solve my problem?