request->getParam('controller');
$action = $this->request->getParam('action');
$curentPath = "{$controller}{$action}";
$breadcrumbLinks = '';
$breadcrumbAction = '';
$this->Breadcrumbs->setTemplates([
'wrapper' => sprintf(
''
),
'item' => '
{{separator}}',
'itemWithoutLink' => '{{separator}}',
'separator' => ''
]);
if (!empty($breadcrumb)) {
foreach ($breadcrumb as $i => $entry) {
if (!empty($entry['textGetter'])) {
$entry['label'] = Cake\Utility\Hash::get($entity, $entry['textGetter']);
}
if (!empty($entry['url_vars'])) {
$entry['url'] = $this->DataFromPath->buildStringFromDataPath($entry['url'], $entity, $entry['url_vars']);
}
$this->Breadcrumbs->add(h($entry['label']), Router::url($entry['url']), [
'title' => h($entry['label']),
'templateVars' => [
'linkClass' => $i == 0 ? 'fw-light' : '',
'icon' => ($i == 0 && !empty($entry['icon'])) ? $this->FontAwesome->getClass(h($entry['icon'])) : ''
]
]);
}
$lastCrumb = $breadcrumb[count($breadcrumb)-1];
if (!empty($lastCrumb['links'])) {
foreach ($lastCrumb['links'] as $i => $linkEntry) {
$active = $linkEntry['route_path'] == $lastCrumb['route_path'];
if (!empty($linkEntry['url_vars'])) {
$linkEntry['url'] = $this->DataFromPath->buildStringFromDataPath($linkEntry['url'], $entity, $linkEntry['url_vars']);
}
$breadcrumbLinks .= sprintf('%s',
$active ? 'secondary' : 'outline-secondary',
Router::url($linkEntry['url']),
h($linkEntry['label'])
);
}
}
if (!empty($lastCrumb['actions'])) {
foreach ($lastCrumb['actions'] as $i => $actionEntry) {
if (!empty($actionEntry['url_vars'])) {
$actionEntry['url'] = $this->DataFromPath->buildStringFromDataPath($actionEntry['url'], $entity, $actionEntry['url_vars']);
}
$breadcrumbAction .= sprintf('%s',
Router::url($actionEntry['url']),
!empty($entry['icon']) ? $this->FontAwesome->getClass(h($actionEntry['icon'])) : '',
h($actionEntry['label'])
);
}
}
}
?>
Breadcrumbs->render(
[],
['separator' => '']
);
?>