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 yesterday

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 22% 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

2822d 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

[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[pid/speakingurl

Generate of so called 'static' or 'Clean URL' or 'Pretty URL' or 'nice-looking URL' or 'Speaking URL' or 'user-friendly URL' or 'SEO-friendly URL' or 'slug' from a string.

1.1k5.3k1](/packages/pid-speakingurl)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

39488.5k](/packages/wazum-sluggi)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

1830.9k](/packages/mdmsoft-yii2-autonumber)[baibaratsky/yii2-serialized-attributes-behavior

Yii2 Serialized Attributes Behavior

1174.1k9](/packages/baibaratsky-yii2-serialized-attributes-behavior)[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.7k](/packages/umanskyi31-opengraph)

PHPackages © 2026

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