AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
# 面包屑制作 ``` function sp_get_path($cid, $title=""){ $term = sp_get_term($cid); $html="<ul class=\"breadcrumb\"> <li><a href=\"__ROOT__\">首页</a> <span class=\"divider\">/</span></li>"; $parent = sp_get_term($term['parent']); if($parent){ $url=UU('portal/list/index',array(id=>$term['parent'])); $html.="<li><a href=\"$url\">${parent['name']}</a> <span class=\"divider\">/</span></li>"; } if(empty($title)){ $html.="<li class=\"active\">${term['name']}</li></ul>"; }else{ $url=UU('portal/list/index',array(id=>$cid)); $html.="<li><a href=\"$url\">${term['name']}</a><span class=\"divider\">/</span></li>"; $html.="<li class=\"active\">$title</li></ul>"; } echo $html; } ``` ##使用方法, 列表页中`{:sp_get_path($cat_id)}` 文章页中`{:sp_get_path($term['term_id'], $post_title)}` 如图所示: ![](https://box.kancloud.cn/2016-09-02_57c8ddd380bc9.png)