PHPackages                             denisok94/yii-metatag - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. denisok94/yii-metatag

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

denisok94/yii-metatag
=====================

Generation of Yii2 meta tags.

0.1.1(3mo ago)038BSD-3-ClausePHP

Since Jun 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Denisok94/yii-metatag)[ Packagist](https://packagist.org/packages/denisok94/yii-metatag)[ RSS](/packages/denisok94-yii-metatag/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (11)Used By (0)

 Yii2 MetaTag Class
====================

[](#-yii2-metatag-class-)

Generation of meta tags.

Installation
============

[](#installation)

Run:

```
composer require --prefer-dist denisok94/yii-metatag
# or
php composer.phar require --prefer-dist denisok94/yii-metatag
```

or add to the `require` section of your `composer.json` file:

```
"denisok94/yii-metatag": "*"
```

```
composer update
# or
php composer.phar update
```

In the settings (`config`), where the `web.php` files are located or `config.php ` specify the name of the site and the main language

```
$config = [
    'name' => 'Site Name',
    'language' => 'en-EN',
    'basePath' => dirname(__DIR__),
    //...
];
```

Use
===

[](#use)

MethodDescriptionstatic::tag()Install MetaTag on the page```
namespace app\controllers;
use \denisok94\helper\yii2\MetaTag;

class NewsController extends Controller
{
    // ...
    public function actionView($id)
    {
        $model = $this->findModel($id);
        //
        MetaTag::tag($this->view, [
            'title' => $model->title,
            'description' => substr($model->text, 0, 100),
            'keywords' => $model->tags, // string
        ]);
        // or
        $this->view->title = $model->title;
        list($width, $height, $type, $attr) = getimagesize(Yii::$app->getBasePath() . $model->image_path);
        MetaTag::tag($this->view, [
            'title' => $model->title,
            'description' => $model->announce,
            'keywords' => implode(', ', $model->tags), // if tags array
            'image' => Url::to($model->image_path, true),
            'image:src' => Url::to($model->image_path, true),
            'image:type' => 'image/jpeg',
            'image:width' => $width,
            'image:height' => $height,
        ]);
        //
        return $this->render('view', ['model' => $model]);
    }
}
```

Specified in `action`, before `render()'.

```
MetaTag::tag($this->view, [
    'nameTag1' => 'valueTag1',
    'nameTag2' => 'valueTag2',
    //...
]);
```

Individual icon(favicon) for the page

```
// Before
$this->view->registerLinkTag(['rel' => 'icon', 'type' => 'image/png', 'href' => Url::to("/favicon.png", true)]);
// Since MetaTag
// todo
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance85

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~148 days

Recently: every ~330 days

Total

10

Last Release

100d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/59793012?v=4)[Денис](/maintainers/Denisok94)[@Denisok94](https://github.com/Denisok94)

---

Top Contributors

[![Denisok94](https://avatars.githubusercontent.com/u/59793012?v=4)](https://github.com/Denisok94 "Denisok94 (4 commits)")

---

Tags

yii2-extensionyii2-metatagyii2-extensionyii2 MetaTagyii2 Meta Tags

### Embed Badge

![Health badge](/badges/denisok94-yii-metatag/health.svg)

```
[![Health](https://phpackages.com/badges/denisok94-yii-metatag/health.svg)](https://phpackages.com/packages/denisok94-yii-metatag)
```

PHPackages © 2026

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