Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Breadcrumbs.php
Go to the documentation of this file.
1 <?php
7 
16 {
22  protected $_links = [];
23 
27  protected $_template = 'Magento_Backend::widget/breadcrumbs.phtml';
28 
32  protected function _construct()
33  {
34  $this->addLink(__('Home'), __('Home'), $this->getUrl('*'));
35  }
36 
43  public function addLink($label, $title = null, $url = null)
44  {
45  if (empty($title)) {
46  $title = $label;
47  }
48  $this->_links[] = ['label' => $label, 'title' => $title, 'url' => $url];
49  return $this;
50  }
51 
55  protected function _beforeToHtml()
56  {
57  // TODO - Moved to Beta 2, no breadcrumbs displaying in Beta 1
58  // $this->assign('links', $this->_links);
59  return parent::_beforeToHtml();
60  }
61 }
$title
Definition: default.phtml:14
__()
Definition: __.php:13
$label
Definition: details.phtml:21
addLink($label, $title=null, $url=null)
Definition: Breadcrumbs.php:43