PHPackages                             veo/slug-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. veo/slug-behavior

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

veo/slug-behavior
=================

veo slug behavior

024PHP

Since Jun 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/orhant/veobu-slug-behavior)[ Packagist](https://packagist.org/packages/veo/slug-behavior)[ RSS](/packages/veo-slug-behavior/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 slug behavior (Semantic URL)
=================================

[](#yii2-slug-behavior-semantic-url)

This solution allows you to generate good slug urls. ([slug wiki](https://en.wikipedia.org/wiki/Semantic_URL)).

Direct generation is engaged in a proven solution [cocur/slugify](https://github.com/cocur/slugify).

[![Latest Stable Version](https://camo.githubusercontent.com/f38ce625743ef31e0b9623a84b26c9ed180f058b2b1af08070e361aa2afc1ce5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736b65656b732f796969322d736c75672d6265686176696f722e737667)](https://packagist.org/packages/skeeks/yii2-slug-behavior)[![Total Downloads](https://camo.githubusercontent.com/fcec5aef6ef4311176087e2e3ebaa4d1880523ddfc87036dd5d225d33c714862/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736b65656b732f796969322d736c75672d6265686176696f722e737667)](https://packagist.org/packages/skeeks/yii2-slug-behavior)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist skeeks/yii2-slug-behavior "*"

```

or add

```
"skeeks/yii2-slug-behavior": "*"

```

How to use
----------

[](#how-to-use)

Attach the behavior in your model:

```
public function behaviors()
{
    return [
        'slug' => [
            'class' => 'skeeks\yii2\slug\SlugBehavior',
            'slugAttribute' => 'slug',                      //The attribute to be generated
            'attribute' => 'name',                          //The attribute from which will be generated
            // optional params
            'maxLength' => 64,                              //Maximum length of attribute slug
            'minLength' => 3,                               //Min length of attribute slug
            'ensureUnique' => true,
            'slugifyOptions' => [
                'lowercase' => true,
                'separator' => '-',
                'trim' => true
                //'regexp' => '/([^A-Za-z0-9]|-)+/',
                //'rulesets' => ['russian'],
                //@see all options https://github.com/cocur/slugify
            ]
        ]
    ];
}
```

Yandex translit :

```
public function behaviors()
{
    return [
        'slug' => [
            'class' => 'skeeks\yii2\slug\SlugBehavior',
            'slugAttribute' => 'slug',                      //The attribute to be generated
            'attribute' => 'name',                          //The attribute from which will be generated
            // optional params
            'slugifyOptions' => [
                'rulesets' => [
                    skeeks\yii2\slug\SlugRuleProvider::YANDEX,
                    'default'
                ]
            ]
        ]
    ];
}
```

Links
-----

[](#links)

- [Github](https://github.com/skeeks-semenov/yii2-slug-behavior)
- [Changelog](https://github.com/skeeks-semenov/yii2-slug-behavior/blob/master/CHANGELOG.md)
- [Issues](https://github.com/skeeks-semenov/yii2-slug-behavior/issues)
- [Packagist](https://packagist.org/packages/skeeks/yii2-slug-behavior)

Demo (view urls)
----------------

[](#demo-view-urls)

-

---

> [![skeeks!](https://camo.githubusercontent.com/e80b006782c0ce0ce23f8e2e2530130e856f2f49c6a5a8e0e15eaf0c87d25d7b/68747470733a2f2f736b65656b732e636f6d2f696d672f6c6f676f2f6c6f676f2d6e6f2d7469746c652d383070782e706e67)](https://skeeks.com)
> *SkeekS CMS (Yii2) — fast, simple, effective!*
> [skeeks.com](https://skeeks.com) | [cms.skeeks.com](https://cms.skeeks.com)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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://www.gravatar.com/avatar/b55ba04e6b9847ed247edc1c996aa8570c5d4edca8a7be7330baae6db46fdb4e?d=identicon)[orhant](/maintainers/orhant)

### Embed Badge

![Health badge](/badges/veo-slug-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/veo-slug-behavior/health.svg)](https://phpackages.com/packages/veo-slug-behavior)
```

###  Alternatives

[corneltek/assetkit

High performance asset manager.

531.4k3](/packages/corneltek-assetkit)

PHPackages © 2026

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