PHPackages                             oxy-coach/yii2-seo-behavior - 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. oxy-coach/yii2-seo-behavior

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

oxy-coach/yii2-seo-behavior
===========================

yii2 slug generating and seo filling helping behavior

v1.1(7y ago)176[1 issues](https://github.com/oxy-coach/yii2-seo-behavior/issues)1BSD-2-ClausePHPPHP &gt;=7.0

Since Aug 20Pushed 7y agoCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (1)

yii2-seo-behavior
=================

[](#yii2-seo-behavior)

This behavior helps with generating slug and filling seo attributes for model based on its name field value

Install via Composer
--------------------

[](#install-via-composer)

Run the following command

```
$ composer require oxy-coach/yii2-seo-behavior "*"
```

or add

```
$ "oxy-coach/yii2-seo-behavior": "*"
```

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

Configuring
-----------

[](#configuring)

Attach the behavior to your model class:

```
use oxycoach\seobehavior\SeoBehavior;

\\ ...

    public function behaviors()
    {
        return [
            'SeoBehavior' => [
                'class' => SeoBehavior::className(),
                'nameAttribute' => 'name',
                'slugAttribute' => 'slug',
                'seoAttributes' => ['seoTitle', 'seoKeywords', 'seoDescription']
            ],
        ];
    }

    public function rules()
    {
        return [
            [['name'], 'required'],
            [['name', 'slug', 'seoTitle', 'seoKeywords', 'seoDescription'], 'string'],
        ];
    }

```

So with that configuration before saving your AR model, if `slug` attribute is empty, it would be filled with generated slug from attribute `name`, and so if any of `seoAttributes` attribute is empty, it would be filled with `name` field value.

> Note that by default slug is generated from string that **expects to contain cytillic symbols**, so if you work with another encoding or symbols, you can provide your own function/method for generating slug using `transliterationFunction` property, like in example below

```
\\ ...

    public function behaviors()
    {
        return [
            'SeoBehavior' => [
                'class' => SeoBehavior::className(),
                'nameAttribute' => 'name',
                'slugAttribute' => 'slug',
                'transliterationFunction' => 'namespace\for\MyTransliterator::myMethod',
                'seoAttributes' => ['seoTitle', 'seoKeywords', 'seoDescription']
            ],
        ];
    }
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Total

3

Last Release

2872d ago

Major Versions

v0.1-BETA → v1.02018-08-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e32476c67f7bbcef24a93e245a6f7cf303e57c40932e8868f2d2bfad91c1897?d=identicon)[oxy-coach](/maintainers/oxy-coach)

---

Top Contributors

[![oxy-coach](https://avatars.githubusercontent.com/u/42410704?v=4)](https://github.com/oxy-coach "oxy-coach (5 commits)")

---

Tags

slugyii2Behaviorgenerationseo

### Embed Badge

![Health badge](/badges/oxy-coach-yii2-seo-behavior/health.svg)

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

###  Alternatives

[v0lume/yii2-meta-tags

DB based model meta data for SEO

194.1k](/packages/v0lume-yii2-meta-tags)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

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

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

1615.4k](/packages/valentinek-yii2-closure-table-behavior)[daxslab/yii2-taggedview

Extension to help setup the standard HTML meta tags besides the ones defined by Opengraph and Twitter to contribute to website SEO

114.7k1](/packages/daxslab-yii2-taggedview)

PHPackages © 2026

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