protected function getBreadcrumbByUrl($url, $home = 'Home')
    {
        $nodes      = explode('/', $url);
        $countNodes = count($nodes);

        $breadcrumb = [];
        $root       = '';

        for ($i = 0; $i < $countNodes; ++$i) {
            $node         = ($i === 0) ? $home : $nodes[$i];
            $breadcrumb[] = [
                'href'   => ($i === 0) ? '/' : ($root.'/'.$node),
                'text'   => $node,
                'active' => ($i === ($countNodes - 1)),
                'class'  => ($i === ($countNodes - 1)) ? 'active' : null,
                'id'     => ($i === ($countNodes - 1)) ? 'breadcrumb' : null,
            ];

            $root .= ($i > 0) ? ('/'.$node) : '';
        }

        return $breadcrumb;
    }
protected function getBreadcrumbByUrl($url, $home = 'Home')
    {
        $nodes      = explode('/', $url);
        $countNodes = count($nodes);

        $breadcrumb = [];
        $root       = '';

        for ($i = 0; $i < $countNodes; ++$i) {
            $node         = ($i === 0) ? $home : $nodes[$i];
            $breadcrumb[] = [
                'href'   => ($i === 0) ? '/' : ($root.'/'.$node),
                'text'   => $node,
                'active' => ($i === ($countNodes - 1)),
                'class'  => ($i === ($countNodes - 1)) ? 'active' : null,
                'id'     => ($i === ($countNodes - 1)) ? 'breadcrumb' : null,
            ];

            $root .= ($i > 0) ? ('/'.$node) : '';
        }

        return $breadcrumb;
    }
protected function getBreadcrumbByUrl ( $ url , $ home = 'Home' ) { $ nodes = explode ( '/' , $ url ) ; $ countNodes = count ( $ nodes ) ; $ breadcrumb = [ ] ; $ root = '' ; for ( $ i = 0 ; $ i < $ countNodes ; ++ $ i ) { $ node = ( $ i === 0 ) ? $ home : $ nodes [ $ i ] ; $ breadcrumb [ ] = [ 'href' => ( $ i === 0 ) ? '/' : ( $ root . '/' . $ node ) , 'text' => $ node , 'active' => ( $ i === ( $ countNodes - 1 ) ) , 'class' => ( $ i === ( $ countNodes - 1 ) ) ? 'active' : null , 'id' => ( $ i === ( $ countNodes - 1 ) ) ? 'breadcrumb' : null , ] ; $ root .= ( $ i > 0 ) ? ( '/' . $ node ) : '' ; } return $ breadcrumb ; }
Returns an array containing a flat structure for a breadcrumb navigation.

@param string $url  The URL used to extract breadcrumb from
@param string $home The crumb used for "Home" e.g. >> Home

@author Benjamin Carl <opensource@clickalicious.de>

@return array The resulting breadcrumb structure
Returns an array containing a flat structure for a breadcrumb navigation .