qq分分彩app|qq分分彩开奖记录官网

一對多關聯查詢返回[]數組,視圖中if還能通過?

瀏覽:320 發布日期:2019/03/24
5.0.0 - 普通 - 已關閉
一對多關聯查詢,with(['attachments']),想實現如果不存在attachments則不顯示外層DIV。但是if判斷一致通過是個什么情況。經過打印$vo.attachments是值是[],但是還能通過if判斷。{if !empty($vo.attachments)}
                            <div class="image-preview-wrapper d-flex">
                                {foreach $vo.attachments as $k => $v}
                                <div class="item">
                                    <img src="{$v.path}{$v.name}" alt="" />
                                </div>
                                {/foreach}
                            </div>
                            {/if}
評論(
后面還有條評論,點擊查看>>
qq分分彩app