mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed DebugView Breadcrumbs to not include query string as separate link, and don't append an arrow after the last element
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64072 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d4c92e29b4
commit
daaf05530c
@ -51,17 +51,18 @@ class DebugView {
|
||||
*/
|
||||
public function Breadcrumbs() {
|
||||
$basePath = str_replace(Director::protocolAndHost(), '', Director::absoluteBaseURL());
|
||||
$parts = explode('/', str_replace($basePath, '', $_SERVER['REQUEST_URI']));
|
||||
$relPath = parse_url(str_replace($basePath, '', $_SERVER['REQUEST_URI']), PHP_URL_PATH);
|
||||
$parts = explode('/', $relPath);
|
||||
$base = Director::absoluteBaseURL();
|
||||
$path = "";
|
||||
$pathPart = "";
|
||||
$pathLinks = array();
|
||||
foreach($parts as $part) {
|
||||
if ($part != '') {
|
||||
$pathPart .= "$part/";
|
||||
$path .= "<a href=\"$base$pathPart\">$part</a>→ ";
|
||||
$pathLinks[] = "<a href=\"$base$pathPart\">$part</a>";
|
||||
}
|
||||
}
|
||||
return $path;
|
||||
return implode('→ ', $pathLinks);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user