SilentLucidity
SilentLucidity

Reputation: 410

Data from associative array in Smarty

I have an associative array and made a datadump of it (See picture) enter image description here

With smarty I want the pw_pro_Code to be visible in a select list

{foreach from=$clientProjects item=Array}
  {foreach from=$Array item=pw_pro_Code}
    <option value="{$pw_pro_Code}">{$pw_pro_Code}</option>
  {/foreach}
{/foreach}

But this shows me both pw_pro_code and pw_wc_InstanceId in list. What am I doing wrong?

Upvotes: 0

Views: 39

Answers (1)

Sougata Bose
Sougata Bose

Reputation: 31739

A single loop would work -

{foreach from=$clientProjects item=Array}
    <option value="{$Array.pw_pro_Code}">{$Array.pw_pro_Code}</option>
{/foreach}

Upvotes: 1

Related Questions