<?php
    /**
     * @var AppView $this
     */

    use App\View\AppView;
    use Cake\Utility\Hash;

    if ($this->Breadcrumbs->getConfig('auto') !== false) {
        if ($this->Breadcrumbs->getConfig('home') !== false) {
            $home = $this->Breadcrumbs->getConfig('home') ?? '/';
            if (Hash::get($this->Breadcrumbs->getCrumbs(), '0.url') !== $home) {
                $this->Breadcrumbs->prepend('Home', $home, ['class' => 'd-none d-md-inline']);
            }
        }

        if ($this->Breadcrumbs->getConfig('current') ?? true) {
            $title = $this->Breadcrumbs->getConfig('current') ?? $this->fetch('title');
            if (Hash::get($this->Breadcrumbs->getCrumbs(), '0.title') !== $title) {
                $this->Breadcrumbs->add($title);
            }
        }
    }

    $content = $this->Breadcrumbs->render(['class' => 'flex-column flex-md-row']);

    if (empty($content)) {
        return;
    }

    echo $this->Html->div('mb-1', $content);

?>
