function breadCrumb() {
global $page_title, $root_url;
// Replace all instances of _ with a space
$PATH_INFO = str_replace("_", " ", "");
// split up the path at each slash
$pathArray = explode("/",$PATH_INFO);
// Initialize variable and add link to home page
if(!isset($root_url)) { $root_url=""; }
$breadCrumbHTML = '<i class="fa fa-home"></i> <a href=//localhost/pitmis/pages'.$root_url.'>Home</a> | ';
// initialize newTrail
$newTrail = $root_url."/";
// starting for loop at 1 to remove root
for($a=1;$a<count($pathArray)-1;$a++) {
// capitalize the first letter of each word in the section name
$crumbDisplayName = ucwords($pathArray[$a]);
// rebuild the navigation path
$newTrail .= $pathArray[$a].'/';
// build the HTML for the breadcrumb trail
$breadCrumbHTML .= '<a href="'.$newTrail.'">'.$crumbDisplayName.'</a> > ';
}
// Add the current page
if(!isset($page_title)) { $page_title = curPage(); }
$breadCrumbHTML .= $page_title;
echo "<li class='active'>
" . $breadCrumbHTML . "
</li>";
}
美好的一天,上面有我的面包屑代码。它工作正常,但它不会在痕迹导航栏上显示文件夹名称或类别名称。当我访问类别部分时,它只会显示Home |类别页面名称。我想要它显示的是“主页|类别|类别页面名称。是否有人愿意帮助我使用我当前的代码。我只是不知道在哪里修改。谢谢。