r3verser / yii2-SluggableBehavior

Yii2 Upgraded SluggableBehavior with more options

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yii2-SluggableBehavior

Yii2 Upgraded SluggableBehavior with more options:

  • transliterator - You can change transliterator for Inflector
  • forceUpdate - Enable/Disable slug attribute update when model updates, if previous slug already exists.

Usage example:

  public function behaviors()
  {
    return [
         [
             'class' => \app\components\SluggableBehavior::className(),
             'attribute' => 'name',
             'slugAttribute' => 'slug',
             'transliterator' => 'Russian-Latin/BGN; NFKD',
             //Set this to true, if you want to update a slug when source attribute has been changed
             'forceUpdate' => false
         ],
     ];
  }

About

Yii2 Upgraded SluggableBehavior with more options

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:PHP 100.0%