This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

alternative way for work with breadcrumbs and meta

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 0


1.0 2017-05-29 04:54 UTC

This package is auto-updated.

Last update: 2021-11-26 19:36:15 UTC


alternative way for work with breadcrumbs and metadata with open-graph-protocol helpers

also include NoLayoutBehavior for registration actions where layout must be skipped

Status Latest Stable Version Total Downloads License


The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist insolita/yii2-metacrumbs "~2.0"

or add

"insolita/yii2-metacrumbs": "~1.0"

to the require section of your composer.json file.


  • register MetaCrumbsBootstrap, or manual register as singleton :



  • add widget in layout
      <?= \insolita\metacrumbs\widgets\CrumbWidget::widget([]) ?>
  • add CrumbedControllerTrait in base controller (or in needed controllers) and register crumbs
  • add MetaManagerTrait in needed controllers or base controller (also in service possible)

Controller Example

class ExampleController extends Controller
    use CrumbedControllerTrait;
    use MetaManagerTrait;

    public function actions()
        return [
            'error'   => [
                'class' => 'yii\web\ErrorAction',

   public function behaviors()
       return [
           'nolayout'=>['class'=>NoLayoutBehavior::class,'actions' => ['ajax']]
           // 'nolayout'=>['class'=>NoLayoutBehavior::class,'actions' => ['index','about'],'except'=>true]

    public function beforeAction($action)
        if ($action->id == 'error') {
            $this->registerCurrentCrumb('Страница ошибок');
        return parent::beforeAction($action);

   public function actionIndex()
       $this->metaManager()->tag('description', 'Bla-bla-la-la-la');
       $this->metaManager()->prop('og:description', 'Bla-bla-bla');
       $this->metaManager()->prop('og:title', 'Bla-bla-bla');
       $this->metaManager()->keywords('Some, keywords,list');
       return $this->render('index');
    public function actionView(int $id)
               new CrumbItem('Special crumb', Url::to(['some/page']), 20, ['target' => '_blank'])
         $model = $this->pageFinder->findById($id);
         return $this->render('about',['model'=>$model]);