PHPackages                             ommu/yii-sluggable - 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. ommu/yii-sluggable

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

ommu/yii-sluggable
==================

Make a unique url out of one or more db fields

1.0.2(7y ago)030Apache-2.0PHPPHP &gt;=5.3.2

Since Aug 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ommu/ext-sluggable)[ Packagist](https://packagist.org/packages/ommu/yii-sluggable)[ Docs](https://github.com/ommu/ext-sluggable)[ RSS](/packages/ommu-yii-sluggable/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

What's it all about?
====================

[](#whats-it-all-about)

With this behavior, you can generate an URI for a single or combination of columns in your table. Some call it permalink, others call it slug or human readable url.

*Check out the latest version at:*[github.com/mintao/yii-behavior-sluggable](https://github.com/mintao/yii-behavior-sluggable)

Imagine a blog table
--------------------

[](#imagine-a-blog-table)

```
| id | category | title                             |
|----+----------+-----------------------------------|
|  1 | security | NASA Server hacked by hacker kids |
| ...
```

So you'd like a better URL than that?
-------------------------------------

[](#so-youd-like-a-better-url-than-that)

*[http://your-blog.org/index.php?r=blog/show&amp;id=1422](http://your-blog.org/index.php?r=blog/show&id=1422)*

What about
----------

[](#what-about)

**

**Google will love you** ;)

How to get it done
==================

[](#how-to-get-it-done)

- Add another column called "*slug*" to your table
- Download this extension and drop it into your protected/extensions folder,
- Add the behavior to your model (shown below)

**If you're using git**, I'd recommend:

```
cd
mkdir -p protected/extensions/behaviors (optional)
git submodule add git://github.com/mintao/yii-behavior-sluggable.git protected/extensions/behaviors/SluggableBehavior
```

Demo configuration of this behavior for your model
--------------------------------------------------

[](#demo-configuration-of-this-behavior-for-your-model)

```
/**
 * Behaviors for this model
 */
public function behaviors(){
  return array(
    'sluggable' => array(
      'class'=>'ext.yii-sluggable.SluggableBehavior',
      'columns' => array('category', 'title', 'author.name'),
      'unique' => true,
      'update' => true,
    ),
  );
}
```

- **class** Defines the path where to find the SluggableBehavor.php
- **columns** Needs to be an array of the fields to use for slug creation
- **unique** Set this to true to ensure a unique slug (Numbers will be added to duplicate slugs, if already existing)
- **update** Set this to true is every time you change the entry, the slug should be updated too. Set it to false, if the slug should be only created once

Download this extension (and fork it):
--------------------------------------

[](#download-this-extension-and-fork-it)

[github.com/mintao/yii-behavior-sluggable](https://github.com/mintao/yii-behavior-sluggable)

Changelog
---------

[](#changelog)

- 2014-08-25 Slight speed improvement
- 2011-04-30 Added *update* functionality
- 2011-06-23 Added support for dependent models (see demo configuration, author.name)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 73.3% 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 ~897 days

Total

3

Last Release

2866d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc55e183fd0f46f18cd61df9e536dda16be7db49036b180542e64dc414e22c25?d=identicon)[ommu](/maintainers/ommu)

---

Top Contributors

[![PutraSudaryanto](https://avatars.githubusercontent.com/u/5587049?v=4)](https://github.com/PutraSudaryanto "PutraSudaryanto (11 commits)")[![wilwade](https://avatars.githubusercontent.com/u/1252199?v=4)](https://github.com/wilwade "wilwade (2 commits)")[![akimsko](https://avatars.githubusercontent.com/u/737250?v=4)](https://github.com/akimsko "akimsko (1 commits)")[![lexxorlov](https://avatars.githubusercontent.com/u/7910574?v=4)](https://github.com/lexxorlov "lexxorlov (1 commits)")

---

Tags

behaviorommu-extensionslugyiisluggableextensionBehavioryiiommuommu-platform

### Embed Badge

![Health badge](/badges/ommu-yii-sluggable/health.svg)

```
[![Health](https://phpackages.com/badges/ommu-yii-sluggable/health.svg)](https://phpackages.com/packages/ommu-yii-sluggable)
```

###  Alternatives

[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3030.6k](/packages/sjaakp-yii2-taggable)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

1830.9k](/packages/mdmsoft-yii2-autonumber)

PHPackages © 2026

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