zabachok / yii2-sluggable-behavior
Поведение для транслитерации кирилицы в латиницу.
Installs: 2 208
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-12-11 17:07:08 UTC
README
Поведение для транслитерации кирилицы в латиницу.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist zabachok/yii2-sluggable-behavior "*"
or add
"zabachok/yii2-sluggable-behavior": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
Behavior for transliterate russian text to latin.
Использовать так же как и оригинальное поведение. Класс унаследован от \yii\behaviors\SluggableBehavior просто переопределен метод generateSlug
use zabachok\behaviors\SluggableBehavior; public function behaviors() { return [ [ 'class' => SluggableBehavior::className(), 'attribute' => 'title', // 'slugAttribute' => 'slug', ], ]; }