调用子分类及子分类的内容
用这个调用出某个分类的全部子分类,然后根据子分类的mids调出所有分类内容
<?php
//调用当前分类所有子分类的mid
$AllChildren = \Widget\Metas\Category\Rows::alloc()->getAllChildren($this->getPageRow()['mid']);
//根据上面子分类mid调用所有分类的信息内容,用$Categories[0]['mid']输出,反正不能自动了
$Categories = \Widget\Metas\Category\Rows::alloc()->getCategories($AllChildren); print_r($Categories);
?>
输出结果print_r($Categories);
Array
(
[0] => Array
(
[mid] => 2
[name] => 乾坤大挪移
[slug] => default
[type] => category
[description] => 软件下载,设计创意资料,黑木崖
[count] => 2
[order] => 1
[parent] => 1
[levels] => 1
[directory] => Array
(
[0] => cjg
[1] => default
)
[permalink] => http://liuchou.com/cjg/default/
[url] => http://liuchou.com/cjg/default/
[feedUrl] => http://liuchou.com/feed/cjg/default/
[feedRssUrl] => http://liuchou.com/feed/rss/cjg/default/
[feedAtomUrl] => http://liuchou.com/feed/atom/cjg/default/
)
[1] => Array
(
[mid] => 5
[name] => 碧海潮生曲
[slug] => rg
[type] => category
[description] => 产业发展信息,内容资讯,光明顶,碧海潮生曲
[count] => 0
[order] => 2
[parent] => 1
[levels] => 1
[directory] => Array
(
[0] => cjg
[1] => rg
)
[permalink] => http://liuchou.com/cjg/rg/
[url] => http://liuchou.com/cjg/rg/
[feedUrl] => http://liuchou.com/feed/cjg/rg/
[feedRssUrl] => http://liuchou.com/feed/rss/cjg/rg/
[feedAtomUrl] => http://liuchou.com/feed/atom/cjg/rg/
)
)
最后修订于 2023-12-26 00:44:58
- 上一篇 页面布局样式
- 下一篇 根据参考图片弄出来的