widgets\Breadcrumbs $links

$links public property

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:

[
    '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:

[
    'label' => 'demo',
    'url' => 'http://example.com',
    'class' => 'external',
]

Since version 2.0.3 each individual link can override global $encodeLabels param like the following:

[
    'label' => '<strong>Hello!</strong>',
    'encode' => false,
]
public array $links = []
doc_Yii
2016-10-30 17:18:13
Comments
Leave a Comment

Please login to continue.