Layout component for Messages

@param  BreadcrumbItem $mainItem
@param  Breadcrumb $breadcrumb
@return string
10698
public function breadcrumb(BreadcrumbItem $mainItem, Breadcrumb $breadcrumb)
    {
        $this->dataCollection->add('mainItem', $mainItem);
        $this->dataCollection->add('breadcrumb', $breadcrumb);

        return $this->render('Breadcrumb');
    }
988019
def parent_breadcrumb(options = {}, &block)
      if block_given?
        gretel_renderer.yield_parent_breadcrumb(options, &block)
      else
        gretel_renderer.parent_breadcrumb(options)
      end
    end
386321
protected function renderCrumb($name, $href, $isLast = false, $position = null)
    {
        if ($this->divider) {
            $divider = " <span class=\"divider\">{$this->divider}</span>";
        } else {
            $divider = '';
        }

        if ($position != null) {
            $positionMeta = "<meta itemprop=\"position\" content=\"{$position}\" />";
        } else {
            $positionMeta = "";
        }

        if (!$isLast) {
            return '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" '
                . "class=\"{$this->listItemCssClass}\" >"
                . "<a itemprop=\"item\" href=\"{$href}\"><span itemprop=\"name\">{$name}</span></a>"
                . "{$positionMeta}{$divider}</li>";
        } else {
            return '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" '
                . "class=\"{$this->listItemCssClass} active\"><span itemprop=\"name\">{$name}</span>"
                . "{$positionMeta}</li>";
        }
    }
1341064
public static function breadcrumb($data, $params = array())
    {
        $defParams = array(
            'parent' => 'ul',
            'child' => 'li',
            'divider' => '<span class="divider">></span>',
            'parent@' => array('class' => 'breadcrumb'),
            'child@' => array()
        );

        $params = array_merge_recursive($defParams, $params);

        $msg = '<' . $params['parent'] . ' ' . Html::attributes($params['parent@']) . '>';

        foreach ($data as $key => $value) {
            $attr = $params['li'];
            if ($key == 0 || $value['first']) {
                $params['child@']['class'] = $params['child@']['class'] . ' first';
            }
            if ($key == (count($data) - 1) || $value['last']) {
                $params['child@']['class'] = $params['child@']['class'] . ' last';
            }

            $msg .= '<' . $params['child'] . ' ' . Html::attributes($params['child@']) . '><a href="' . $value['link'] . '">' . $value['name'] . '</a>' . $params['divider'] . '</' . $params['child'] . '>';
        }
        $msg .= '</' . $params['parent'] . '>';

        return $msg;
    }
1041204
public function mainMenuAuto()
    {
        $markup = null;

        $menu = false;
        $classes = array('nav');

        if (!$menu || !is_string($menu) || (isset($_GET['menu_cache']) && $_GET['menu_cache'] == 'false')) {
            if (!empty(get_field('nav_primary_align', 'option'))) {
                $classes[] = 'nav-' . get_field('nav_primary_align', 'option');
            }

            $menu = new \Municipio\Helper\NavigationTree(array(
                'theme_location' => 'main-menu',
                'include_top_level' => true,
                'render' => get_field('nav_primary_render', 'option'),
                'depth' => 1,
                'sublevel' => get_field('nav_primariy_second_level', 'option'),
                'classes' => implode(' ', apply_filters('Municipio/main_menu_classes', $classes)) . ' ' . apply_filters('Municipio/desktop_menu_breakpoint', 'hidden-xs hidden-sm')
            ));

            if (isset($menu) && $menu->itemCount() > 0) {
                $markup = apply_filters('Municipio/main_menu/items', $menu->render(false));
            }

            return $markup;
        }

        return $menu;
    }
902873
protected function setBreadcrumbViewHelp()
    {
        $breadcrumbs = array();

        $breadcrumbs[] = array(
            'url' => $this->url('admin'),
            'text' => $this->text('Dashboard')
        );

        $breadcrumbs[] = array(
            'url' => $this->url('admin/help'),
            'text' => $this->text('Help')
        );

        $this->setBreadcrumbs($breadcrumbs);
    }
1177631
private function createBreadcrumbRoot()
    {
        if (null === $this->breadcrumb) {
            if (null === $home = $this->pageHelper->getHomePage()) {
                throw new \RuntimeException('Home page not found.');
            }
            $this->breadcrumb = $this->factory->createItem('root', [
                'childrenAttributes' => [
                    'class' => 'breadcrumb hidden-xs',
                ],
            ]);
            $this->tagManager->addTags($home->getEntityTag());
        }
    }
881774
public function taxonomy_term_breadcrumbs( $term, $taxonomy ) {

		$term_breadcrumbs = array();

		if ( ! empty( $term ) ) {

			$term_obj = get_term( $term, $taxonomy ); // in case $term is ID, not already object

			// Current term
			$this->add_breadcrumb( $term_breadcrumbs, array(
				$term_obj->name,
				get_term_link( $term_obj, $taxonomy )
			) );

			// Parent terms?
			if ( ! empty( $term_obj->parent ) ) {

				$parent_term_breadcrumbs = array();

				// Traverse through parent terms
				$parent_term_id = $term_obj->parent;
				while ( $parent_term_id ) { // keep moving down levels until there are no more parent terms

					$parent_term = get_term( $parent_term_id, $taxonomy );
					$parent_term_id  = $parent_term->parent; // if this parent has a parent, while loop will continue

					$parent_term_breadcrumbs[] = array(
						$parent_term->name,
						get_term_link( $parent_term, $taxonomy )
					);

				}

				// Reverse parent term array and marge into main breadcrumbs
				$this->add_breadcrumbs_array( $term_breadcrumbs, $parent_term_breadcrumbs );

			}

		}

		$term_breadcrumbs = apply_filters( 'ctc_taxonomy_term_breadcrumbs', $term_breadcrumbs, $term, $taxonomy );

		return $term_breadcrumbs;

	}
902956
private function breadcrumb(EnvironmentInterface $environment)
    {
        $event = new GetBreadcrumbEvent($environment);
        $environment->getEventDispatcher()->dispatch($event::NAME, $event);
        $elements = $event->getElements();
        if (empty($elements)) {
            return null;
        }

        $GLOBALS['TL_CSS']['cca.dc-general.generalBreadcrumb'] = 'bundles/ccadcgeneral/css/generalBreadcrumb.css';

        return $this
            ->getTemplate('dcbe_general_breadcrumb')
            ->set('elements', $elements)
            ->parse();
    }
972120
function addBreadCrumb($route_name, $params = [], $replacements = []) {
        $url        = route($route_name, $params, false);
        $title                   = \LaraPage::pageTitle($route_name, $replacements);
        $h1                      = \LaraPage::pageH1($route_name, $replacements);
        $h1_ext                  = \LaraPage::pageH1Ext($route_name, $replacements);
        $description             = \LaraPage::pageH1Ext($route_name, $replacements);
        $icon                    = Route::routeIcons($route_name);
        $this->breadcrumbs[$url] = compact('title', 'icon');
        $this->setUrl($url);
        $_title = [];
        foreach($this->breadcrumbs as $url => $breadcrumb) {
            $_title[] = Arr::get($breadcrumb, 'title');
        }
        $_title = array_reverse($_title);
        $this->setTitle(implode(', ', $_title))->setDescription($description);

        return $this;
    }
439058
public static function getNavigationalBreadcrumbs($parentId, $crumbs = [])
    {
        $menuItems = self::getMenuItems('id');

        if (in_array($parentId, $menuItems)) {
            array_unshift($crumbs, [
                'link' => $menuItems[$parentId]->url,
                'text' => $menuItems[$parentId]->title,
            ]);

            if (!is_null($menuItems[$parentId]->parent_id)) {
                $crumbs = Breadcrumbs::getNavigationalBreadcrumbs($menuItems[$parentId]->parent_id, $crumbs);
            }
        }

        return $crumbs;
    }
1268549
public function setMainMessage(string $message, bool $translate = true) {
        $this->mainMessage = $translate ? $this->translate($message) : $message;
        return $this;
    }
252430
public function newLayoutCreateStruct(LayoutTypeInterface $layoutType, string $name, string $mainLocale): LayoutCreateStruct
    {
        $struct = new LayoutCreateStruct();
        $struct->layoutType = $layoutType;
        $struct->name = $name;
        $struct->mainLocale = $mainLocale;

        return $struct;
    }
88278
public function createItem($text, $href, $title = '')
    {
        $breadcrumb = new BreadcrumbObject();

        $breadcrumb->setText($text);
        $breadcrumb->setHref($href);

        if ($title) {
            $breadcrumb->setTitle($title);
        }

        $this->breadcrumbs[] = $breadcrumb;

        return $breadcrumb;
    }
1162037
public function breadcrumbs_add_userdashboard() {
		$brouter = BRouter::getInstance();
		return $this->breadcrumbs_add('//' . $brouter->generateurl('users', BLang::$langcode, array('view' => 'dashboard')), BLang::_('USERS_DASHBOARD_HEADING'), true);
	}
1046441
public function getBreadcrumbs($currentPid = 0, $defaultLabel = '列表', $url = '', $urlParams = [], $appendToTop = [], $append = [])
    {
        /** @var \yii\db\ActiveRecord $model */
        $model = $this->owner;
        // 顶级面包屑
        $breadcrumbs[] = $defaultLabel;
        // 非顶级数据则获取该值的所有父级数据
        if (!empty($currentPid)) {
            if ($model->{$this->pkField} == $currentPid) {
                $self = $model;
            } else {
                /** @var self $self 当前`$currentPid`的模型数据 */
                $self = $model::find()->select([
                    $this->pkField,
                    $this->showTitleField,
                    $this->parentField,
                ])->where([$this->pkField => $currentPid])->one();
            }
            
            // 当前模型数据的所有父级数据
            $parentIds = $self->getParentIds();
            if (!empty($parentIds)) {
                $parents = $model::find()->select([
                    $this->pkField,
                    $this->showTitleField,
                    $this->parentField,
                ])->where([
                    $this->pkField => $parentIds,
                ])->asArray()->all();
                $parents = ArrayHelper::listToTree($parents, $this->pkField, $this->parentField, '_child');
                // 所有的父级面包屑
                $breadcrumbs = ArrayHelper::merge($breadcrumbs, $this->_toFormatBreadcrumbs($parents));
            }
            // 包含自身面包屑
            $breadcrumbs[$self->{$this->pkField}] = $self->{$this->showTitleField};
        }
        
        // 格式化面包屑
        foreach ($breadcrumbs as $id => &$title) {
            $arr = [];
            $arr['label'] = $title;
            if ($currentPid != $id || $append) {
                $arr['url'][] = $url;
                $arr['url'][$this->breadcrumbParentParam] = $id ?: null;
                if ($urlParams) {
                    $arr['url'] = ArrayHelper::merge($urlParams, $arr['url']);
                }
            }
            $title = $arr;
        }
        
        // 添加自定义面包屑在已有面包屑后面
        if ($append) {
            $breadcrumbs = ArrayHelper::merge($breadcrumbs, $append);
        }
        
        // 添加自定义面包屑在所有面包屑前端
        if ($appendToTop) {
            $breadcrumbs = ArrayHelper::merge($appendToTop, $breadcrumbs);
        }
        
        return $breadcrumbs;
    }
366299
public function renderBreadcrumbsAction(ResourceNode $node, array $_breadcrumbs)
    {
        //this trick will never work with shortcuts to directory
        //we don't support directory links anymore
        $nodeFromSession = $this->request->getSession()->get('current_resource_node');
        $node = $nodeFromSession !== null ? $nodeFromSession: $node;
        $workspace = $node->getWorkspace();
        $ancestors = $this->resourceManager->getAncestors($node);

        return array(
            'ancestors' => $ancestors,
            'workspaceId' => $workspace->getId(),
        );
    }