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.2(4w ago)040BSD-3-ClausePHP

Since Jun 11Pushed 4w 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 1w ago

READMEChangelog (9)Dependencies (4)Versions (12)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
```

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 pagetags()Install MetaTag on the pagesetFavicon()change the page icon favicon```
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,
        ]);
        // or
        $tag = new MetaTag($view);
        $tag->tags([
            'title' => $model->title,
            //....
        ]);
        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
$tag = new MetaTag($view);
$tag->setFavicon("/favicon.png");
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance94

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~150 days

Recently: every ~372 days

Total

11

Last Release

29d 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 (5 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)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13926.0k66](/packages/skeeks-cms)

PHPackages © 2026

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