用smarty php打印链接

时间:2014-04-13 17:18:38

标签: php css smarty

此代码块打印到div的链接,但第一个链接打印在正确的位置,其余打印在div之外。任何想法为什么?

{if count($from)}
<div class="classifieds">
<div class="pop">
<ul>
{foreach from=$from item=item key=key name=tmp}
  <li>
    <div class="title"><a href="{$item.link}">{$item.title}</a></div>
  </li>
   {if $item.featured}</div>{/if}
{/foreach}
</ul>
</div>
 </div>
{else}
<div class="centerText">{$language.nothing_found}</div>
{/if}

1 个答案:

答案 0 :(得分:1)

如果我能正确理解

{if count($from)}
<div class="classifieds">
<div class="pop">
<ul>
{foreach from=$from item=item key=key name=tmp}
  <li>
    <div class="title"><a href="{$item.link}">{$item.title}</a></div>
  </li>
   {if $item.featured}</div>{/if}//remove this line
{/foreach}
</ul>
</div>
 </div>
{else}
<div class="centerText">{$language.nothing_found}</div>
{/if}