PHPackages                             pantera-digital/yii2-seo - 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. pantera-digital/yii2-seo

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

pantera-digital/yii2-seo
========================

Yii2 SEO module

23.6k1[3 issues](https://github.com/pantera-digital/yii2-seo/issues)PHP

Since Oct 15Pushed 4y ago4 watchersCompare

[ Source](https://github.com/pantera-digital/yii2-seo)[ Packagist](https://packagist.org/packages/pantera-digital/yii2-seo)[ RSS](/packages/pantera-digital-yii2-seo/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 SEO module
===============

[](#yii2-seo-module)

SEO-fields for your models: title, description, keywords and some others

Install
-------

[](#install)

Run

```
php composer require pantera-digital/yii2-seo "*"

```

Or add to composer.json

```
"pantera-digital/yii2-seo": "*",

```

and execute:

```
php composer update

```

Миграция:

```
php yii migrate --migrationPath=vendor/pantera-digital/yii2-seo/migrations

```

Настройка
---------

[](#настройка)

Модуль зависит от  для полной работы пресетов нужно сконфигурировать это расширение

Usage
-----

[](#usage)

Attach behavior to your model:

```
    function behaviors()
    {
        return [
            'seo' => [
                'class' => 'pantera\seo\behaviors\SeoFields',
            ],
        ];
    }
```

Example of use in view:

```
if (!$title = $model->seo->title) {
    $title = "Buy {$model->name} in store";
}

if (!$description = $model->seo->description) {
    $description = 'Page ' . $model->name;
}

if (!$keywords = $model->seo->keywords) {
    $keywords = '';
}

$this->title = $title;

$this->registerMetaTag([
    'name' => 'description',
    'content' => $description,
]);

$this->registerMetaTag([
    'name' => 'keywords',
    'content' => $keywords,
]);
```

Widgets
-------

[](#widgets)

Add to your model form:

```

```

Нужно подключить компонент в конфиг

```
'components' => [
    'seo' => [
        'class' => pantera\seo\components\SeoComponent::className(),
    ],
]

```

Использование регистрации мета данных по адресу
-----------------------------------------------

[](#использование-регистрации-мета-данных-по-адресу)

Нужно подключить в бутстрап приложения класс

```
'bootstrap' => [pantera\seo\Registrar::className()],

```

### Not found

[](#not-found)

Для логирования нужно в обработчик ошибок добавить

```
if ($exception instanceof NotFoundHttpException) {
    $logger = new pantera\seo\models\SeoNotFound();
    $logger->url = Yii::$app->request->url;
    $logger->referrer = Yii::$app->request->referrer;
    $logger->ip = Yii::$app->request->getRemoteIP();
    $logger->save();
}

```

### Slug

[](#slug)

В модель нужно добавить поведение

```
public function behaviors()
{
    return [
        [
            'class' => pantera\seo\behaviors\SlugBehavior::className(),
            'attribute' => 'title',
            'slugAttribute' => 'slug',
        ],
    ];
}

```

В модель подключить валидатор

```
public function rules()
{
    return [
        [['slug'], pantera\seo\validators\SlugValidator::className(), 'skipOnEmpty' => false],
    ];
}

```

Сконфигурировать свой UrlManager

### Модуль имеит возможность регистрации Open Graph тегов

[](#модуль-имеит-возможность-регистрации-open-graph-тегов)

нужно сконфигурировать расширение

```
'components' => [
    'openGraph' => [
        'class' => dragonjet\opengraph\OpenGraph::class,
    ],
],

```

В поле Og Image нужно написать как получить картинку используя twig

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/642519?v=4)[Alex Kostin](/maintainers/webmayak)[@webmayak](https://github.com/webmayak)

---

Top Contributors

[![Singletonn](https://avatars.githubusercontent.com/u/9639275?v=4)](https://github.com/Singletonn "Singletonn (72 commits)")[![webmayak](https://avatars.githubusercontent.com/u/642519?v=4)](https://github.com/webmayak "webmayak (18 commits)")[![numkms](https://avatars.githubusercontent.com/u/22604903?v=4)](https://github.com/numkms "numkms (6 commits)")

### Embed Badge

![Health badge](/badges/pantera-digital-yii2-seo/health.svg)

```
[![Health](https://phpackages.com/badges/pantera-digital-yii2-seo/health.svg)](https://phpackages.com/packages/pantera-digital-yii2-seo)
```

###  Alternatives

[trntv/yii2-aceeditor

Yii2 ajax.org Ace Editor widget

43817.4k20](/packages/trntv-yii2-aceeditor)[verbb/tablemaker

Create customizable and user-defined table fields.

40174.4k2](/packages/verbb-tablemaker)

PHPackages © 2026

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