Widget provides SEO schema for Breadcrumbs widget in Yii2 Framework
Run command
composer require black-lamp/yii2-seo-breadcrumbs
or add
"black-lamp/yii2-seo-breadcrumbs": "^1.1.0"
to the require section of your composer.json.
Call widget in view layout
<?= \bl\seo\SeoBreadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
in view file just add a item or items to params array
$this->params['breadcrumbs'][] = 'Contacts';
or call the widget with configuration array in view file
<?= \bl\seo\SeoBreadcrumbs::widget([
'homeLink' => [
'label' => 'Home',
'url' => \yii\helpers\Url::toRoute(['/']),
],
'links' => 'Contacts',
]) ?>