Property | Type | Description | |
---|---|---|---|
$activeItemTemplate | the template used to render each active item in the breadcrumbs. The token {link} will be replaced with the actual HTML link for each active item. | ||
$encodeLabels | whether to HTML-encode the link labels. | ||
$homeLink | the first hyperlink in the breadcrumbs (called home link). Please refer to [[links]] on the format of the link. If this property is not set, it will default to a link pointing to [[\yii\web\Application::homeUrl]] with the label 'Home'. If this property is false, the home link will not be rendered. | ||
$itemTemplate | the template used to render each inactive item in the breadcrumbs. The token {link} will be replaced with the actual HTML link for each inactive item. | ||
$links | list of links to appear in the breadcrumbs. If this property is empty, the widget will not render anything. Each array element represents a single link in the breadcrumbs with the following structure: php [ 'label' => 'label of the link', // required 'url' => 'url of the link', // optional, will be processed by Url::to() 'template' => 'own template of the item', // optional, if not set $this->itemTemplate will be used ] If a link is active, you only need to specify its "label", and instead of writing ['label' => $label], you may simply use $label. Since version 2.0.1, any additional array elements for each link will be treated as the HTML attributes for the hyperlink tag. For example, the following link specification will generate a hyperlink with CSS class external: php [ 'label' => 'demo', 'url' => 'http://example.com', 'class' => 'external', ] Since version 2.0.3 each individual link can override global [[encodeLabels]] param like the following: php [ 'label' => 'Hello!', 'encode' => false, ] | ||
$options | the HTML attributes for the breadcrumb container tag. | ||
$tag | the name of the breadcrumb container tag. |
Method | Description | |
---|---|---|
run ( ) | Renders the widget. |
Method | Description | |
---|---|---|
renderItem ( array $link, string $template ) : string | Renders a single breadcrumb item. |
protected renderItem ( array $link, string $template ) : string | ||
$link | array | the link to be rendered. It must contain the "label" element. The "url" element is optional. |
$template | string | the template to be used to rendered the link. The token "{link}" will be replaced by the link. |
return | string | the rendering result |
public $activeItemTemplate |
public $homeLink |
public $itemTemplate |
public $links |