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>';
    }