Cake\View\Helper\HtmlHelper::getCrumbs PHP Method

getCrumbs() public method

If $startText is an array, the accepted keys are: - text Define the text/content for the link. - url Define the target of the created link. All other keys will be passed to HtmlHelper::link() as the $options parameter.
public getCrumbs ( string $separator = '»', string | array | boolean $startText = false ) : string | null
$separator string Text to separate crumbs.
$startText string | array | boolean This will be the first crumb, if false it defaults to first crumb in array. Can also be an array, see above for details.
return string | null Composed bread crumbs
    public function getCrumbs($separator = '»', $startText = false)
    {
        $crumbs = $this->_prepareCrumbs($startText);
        if (!empty($crumbs)) {
            $out = [];
            foreach ($crumbs as $crumb) {
                if (!empty($crumb[1])) {
                    $out[] = $this->link($crumb[0], $crumb[1], $crumb[2]);
                } else {
                    $out[] = $crumb[0];
                }
            }
            return implode($separator, $out);
        }
        return null;
    }