function crumbs_BreadcrumbBuilder::buildBreadcrumb in Crumbs, the Breadcrumbs suite 7.2
Same name and namespace in other branches
- 7 lib/BreadcrumbBuilder.php \crumbs_BreadcrumbBuilder::buildBreadcrumb()
Parameters
array[] $trail: Trail items, keyed by system path.
Return value
array[] Breadcrumb items, keyed numerically.
File
- lib/
BreadcrumbBuilder.php, line 25
Class
Code
function buildBreadcrumb($trail) {
$breadcrumb = array();
foreach ($trail as $path => $item) {
if ($item) {
$title = $this->pluginEngine
->findTitle($path, $item, $breadcrumb);
if (!isset($title)) {
$title = $item['title'];
}
// The item will be skipped, if $title === FALSE.
if (isset($title) && $title !== FALSE && $title !== '') {
$item['title'] = $title;
$breadcrumb[] = $item;
}
}
}
return $breadcrumb;
}