ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 如何可以讓多圖內容字段,在內容頁一行三列展示圖片 2 0
迅睿CMS版本:1.2.0

如何可以讓多圖內容字段,在內容頁一行三列展示圖片。我這個代碼只能多行展示。大家幫我看看那里錯了。指點一下。謝謝。

現在代碼如下:

<?php if ($t['fytp']) { foreach ($t['fytp'] as $c) { ?>
 {$i}
 <div style="width:50px; height:50px; overflow:hidden;">
<img src="{dr_thumb($c, 200, 200)}" >
</div> <?php } } ?>
解決方案
  • {php $arr = array_chunk($t['fytp'], 3, true);}
    
    <?php if ($arr ) { foreach ($arr  as $cc) { ?>
    
     <div style="width:50px; height:50px; overflow:hidden;">
    {loop $cc $c}
    <img src="{dr_thumb($c, 200, 200)}" >
    {/loop}
    </div> 
    
    <?php } } ?>

    不要只復制代碼拿去用,而要明白為什么這樣寫,這樣寫的意圖是什么,每句話的意義是什么,學會了邏輯思路,以后遇到同類型的問題就迎刃而解了

    滿意答案
    開源積分+10
  • <?php if ($t['fytp']) { foreach ($t['fytp'] as $c) { ?>
     {$i}
            <img src="{dr_thumb($c, 200, 200)}" width="83" height="83" style="margin-top: 15px;">
        </a><?php } } ?>

    @迅睿框架技術-李波

  • @迅??蚣芗夹g-李波:感謝,你讓我知道以后怎樣寫代碼,讓我不要再復制粘貼或抄回來