request->getParam('controller');
$action = $this->request->getParam('action');
$curentPath = "{$controller}{$action}";
$navbarVariant = Configure::read('navbarVariant');
$navbarIsDark = Configure::read('navbarIsDark');
// $pass = $this->request->getParam('pass');
$breadcrumbLinks = '';
$breadcrumbAction = '';
$this->Breadcrumbs->setTemplates([
'wrapper' => sprintf(
''
),
'item' => sprintf(
'
{{separator}}',
empty($darkMode) ? 'light' : 'dark'
),
'itemWithoutLink' => '{{separator}}',
'separator' => ''
]);
if (!empty($breadcrumb)) {
foreach ($breadcrumb as $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($entry['label'], Router::url($entry['url']));
}
$lastCrumb = $breadcrumb[count($breadcrumb)-1];
if (!empty($lastCrumb['links']) || !empty($lastCrumb['actions'])) {
$this->Breadcrumbs->add([[]]); // add last separetor
}
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' : $navbarVariant,
Router::url($linkEntry['url']),
$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']), $actionEntry['label']);
}
}
}
?>
Breadcrumbs->render(
[],
['separator' => '']
);
?>