PHPackages                             v0lume/yii2-meta-tags - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. v0lume/yii2-meta-tags

ActiveYii2-extension

v0lume/yii2-meta-tags
=====================

DB based model meta data for SEO

v1.2.3(8y ago)204.1k7[2 issues](https://github.com/v0lume/yii2-meta-tags/issues)MITPHP

Since Mar 12Pushed 8y ago2 watchersCompare

[ Source](https://github.com/v0lume/yii2-meta-tags)[ Packagist](https://packagist.org/packages/v0lume/yii2-meta-tags)[ RSS](/packages/v0lume-yii2-meta-tags/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

yii2-meta-tags
==============

[](#yii2-meta-tags)

DB based model meta data for SEO

[![screenshot](https://cloud.githubusercontent.com/assets/5075100/6626492/fc4a689e-c907-11e4-85aa-af653a455ad0.jpg)](https://cloud.githubusercontent.com/assets/5075100/6626492/fc4a689e-c907-11e4-85aa-af653a455ad0.jpg)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer.phar require --prefer-dist v0lume/yii2-meta-tags "*"
```

or add

```
"v0lume/yii2-meta-tags": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Add `MetaTagBehavior` to your model, and configure it.

```
public function behaviors()
{
    return [
        'MetaTag' => [
            'class' => MetaTagBehavior::className(),
        ],
    ];
}
```

Add `MetaTags` somewhere in you application, for example in editing form.

```
echo MetaTags::widget([
    'model' => $model,
    'form' => $form
]);
```

Done! Now, you can get meta data of your current model:

```
echo $model->getBehavior('MetaTag')->title;
echo $model->getBehavior('MetaTag')->keywords;
echo $model->getBehavior('MetaTag')->description;
```

Or, by manually find model:

```
use v0lume\yii2\metaTags\model\MetaTag;

...

$meta_tag = MetaTag::findOne([
    'model_id' => $id,
    'model'  => (new \ReflectionClass($model))->getShortName()
]);

...

echo $meta_tag->title;
echo $meta_tag->keywords;
echo $meta_tag->description;
```

Auto registration meta tags
---------------------------

[](#auto-registration-meta-tags)

You can use `MetaTagsComponent` to perform auto registration meta tags

Configure `MetaTagsComponent` in `main.php` config:

```
...
'components' => [
    ...
    'metaTags' => [
        'class' => 'v0lume\yii2\metaTags\MetaTagsComponent',
        'generateCsrf' => false,
        'generateOg' => true,
    ],
    ...
],
...

```

And then, in your layouts or views or controller action

```
$model = \common\models\Page::findOne(['url' => '/']);

Yii::$app->metaTags->register($model);
```

If passed $model was attached `MetaTagBehavior`, component will register meta tags for that model. If `MetaTagBehavior` wasn't attached or model not passed, and `generateCsrf` is set to true, component will generate only csrf meta tags.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~170 days

Recently: every ~213 days

Total

6

Last Release

3227d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65915b85b65d3e21ab9d627215efeee25f6bfbd805b0423eb0cfd04ef0bce07c?d=identicon)[v0lume](/maintainers/v0lume)

---

Top Contributors

[![v0lume](https://avatars.githubusercontent.com/u/5075100?v=4)](https://github.com/v0lume "v0lume (11 commits)")[![gvital3230](https://avatars.githubusercontent.com/u/8995097?v=4)](https://github.com/gvital3230 "gvital3230 (1 commits)")

---

Tags

yii2extensionBehavioractive-recordseometameta-tags

### Embed Badge

![Health badge](/badges/v0lume-yii2-meta-tags/health.svg)

```
[![Health](https://phpackages.com/badges/v0lume-yii2-meta-tags/health.svg)](https://phpackages.com/packages/v0lume-yii2-meta-tags)
```

###  Alternatives

[nickcv/yii2-encrypter

Openssl Encrypter for Yii2

19640.0k1](/packages/nickcv-yii2-encrypter)[voskobovich/yii2-linker-behavior

This behavior makes it easy to maintain many-to-many and one-to-many relations in your ActiveRecord models.

80319.0k9](/packages/voskobovich-yii2-linker-behavior)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

1830.9k](/packages/mdmsoft-yii2-autonumber)[valentinek/yii2-closure-table-behavior

This extension allows you to get functional for closure table trees.

1615.3k](/packages/valentinek-yii2-closure-table-behavior)[liyunfang/yii2-upload-behavior

Upload behavior for Yii 2

161.7k](/packages/liyunfang-yii2-upload-behavior)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
