<?php // 栏目表 return [ 0=> ['id'=>1, 'name'=>'新闻','desc'=>'新闻列表'], 1=> ['id'=>2, 'name'=>'产品','desc'=>'产品列表'], 1=> ['id'=>3, 'name'=>'xxx','desc'=>'xxx列表'], ];
2=> [
'id' => 3,
'name' => '详情-通用-模板',
'style' => [
'default' => 'detail_general_default.php',
'light' => 'detail_general_light.php',
'dark' => 'detail_general_dark.php',
]
// 1. xxx列表信息
$cid = 3;
$news = array_filter($arts, function ($art) use ($cid) {
return $art['cid'] == $cid;
});
<div class="news">
<h3>xxx列表</h3>
<div class="list">
<?php for ($i=0;$i<5;$i++) : extract($news[$i])?>
<a
href="<?=$url.'?cid='.$cid.'&id='.$id?>"><?=mb_substr($title, 0, 18) ?>...</a>
<?php endfor ?>
</div>
</div>