title: Assign variable in smarty?
body: <p>I have assigned two array to smarty : <code>profiles</code> and <code>selected_id</code> . <code>profiles</code> array contains the array of all profiles and the <code>selected_id</code> array contains ids of the profiles to be displayed .So I am displaying the all profiles like this :</p>
  
  <pre><code>&lt;select id="countries" class="multiselect" multiple="multiple" name="profiles[]"&gt;
          {foreach name = feach item = k from = $profiles}
              &lt;option value="{$k-&gt;bz_pro_id}"&gt;{$k-&gt;bz_pro_first_name} {$k-&gt;bz_pro_last_name}&lt;/option&gt;
          {/foreach}
        &lt;/select&gt;
  </code></pre>
  
  <p>Now I want to default select the ids that are already selected by admin . That means if I want to add <code>selected = "selected"</code> in the <code>option</code> of <code>select</code> . For that I write :</p>
  
  <pre><code>{foreach name = feach item = k from = $profiles}
          {foreach name = feach2 item = k2 from = $selected_id}
                  {if $k-&gt;bz_pro_id == $k2-&gt;bz_pro_id}
                          selected = "selected"
                  {/if}
          {/foreach}
  {/foreach}
  </code></pre>
  
  <p>So can I assign the <code>select = "selected"</code> to a variable so that I can use it in the <code>option</code> ?</p>