Skip to content

Latest commit

 

History

History
44 lines (40 loc) · 1.47 KB

README.md

File metadata and controls

44 lines (40 loc) · 1.47 KB

SEO breadcrumbs widget for Yii2

Widget provides SEO schema for Breadcrumbs widget in Yii2 Framework

Build Status Latest Stable Version Latest Unstable Version License

Installation

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.

Using

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',
]) ?>