src/Common.php
public function breadcrumbs(array $links)
    {
        if (empty($links)) {
            return '';
        }
        foreach ($links as $name => $href) {
            if (is_array($href)) {
                list($dropdown, $id) = $this->dropdown($href);
                $link = $this->page->tag('a', array('href' => '#', 'data-toggle' => 'dropdown', 'id' => $id), $name, '<b class="caret"></b>');
                $links[$name] = '<li class="dropdown">'.$link.$dropdown.'</li>';
            } else {
                $links[$name] = '<li><a href="'.$href.'">'.$name.'</a></li>';
            }
            if ($name === 0) {
                $name = $href; // this should only happen to the last breadcrumb
            }
        }
        array_pop($links);

        return '<ul class="breadcrumb">'.implode(' ', $links).' <li class="active">'.$name.'</li></ul>';
    }
public function breadcrumbs(array $links)
    {
        if (empty($links)) {
            return '';
        }
        foreach ($links as $name => $href) {
            if (is_array($href)) {
                list($dropdown, $id) = $this->dropdown($href);
                $link = $this->page->tag('a', array('href' => '#', 'data-toggle' => 'dropdown', 'id' => $id), $name, '<b class="caret"></b>');
                $links[$name] = '<li class="dropdown">'.$link.$dropdown.'</li>';
            } else {
                $links[$name] = '<li><a href="'.$href.'">'.$name.'</a></li>';
            }
            if ($name === 0) {
                $name = $href; // this should only happen to the last breadcrumb
            }
        }
        array_pop($links);

        return '<ul class="breadcrumb">'.implode(' ', $links).' <li class="active">'.$name.'</li></ul>';
    }
public function breadcrumbs ( array $ links ) { if ( empty ( $ links ) ) { return '' ; } foreach ( $ links as $ name => $ href ) { if ( is_array ( $ href ) ) { list ( $ dropdown , $ id ) = $ this -> dropdown ( $ href ) ; $ link = $ this -> page -> tag ( 'a' , array ( 'href' => '#' , 'data-toggle' => 'dropdown' , 'id' => $ id ) , $ name , '<b class="caret"></b>' ) ; $ links [ $ name ] = '<li class="dropdown">' . $ link . $ dropdown . '</li>' ; } else { $ links [ $ name ] = '<li><a href="' . $ href . '">' . $ name . '</a></li>' ; } if ( $ name === 0 ) { $ name = $ href ; // this should only happen to the last breadcrumb } } array_pop ( $ links ) ; return '<ul class="breadcrumb">' . implode ( ' ' , $ links ) . ' <li class="active">' . $ name . '</li></ul>' ; }
Creates a Bootstrap styled breadcrumb trail. The last link is automatically activated.

@param array $links An ``array($name => $href)`` of links to display. The **$href** may also be another ``array($name => $href)`` of dropdown links.

@return string

@example

```php
$bp->breadcrumbs(array(
'Home' => '#',
'Library' => '#',
'Data' => '#',
));
```
Creates a Bootstrap styled breadcrumb trail . The last link is automatically activated .