Sluggble behavior
ΠΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅ Π΄Π»Ρ ΡΡΠ°Π½ΡΠ»ΠΈΡΠ΅ΡΠ°ΡΠΈΠΈ ΠΊΠΈΡΠΈΠ»ΠΈΡΡ Π² Π»Π°ΡΠΈΠ½ΠΈΡΡ., (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist zabachok/yii2-sluggable-behavior "*"
or add, (*4)
"zabachok/yii2-sluggable-behavior": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
Behavior for transliterate russian text to latin., (*7)
ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΡΠ°ΠΊ ΠΆΠ΅ ΠΊΠ°ΠΊ ΠΈ ΠΎΡΠΈΠ³ΠΈΠ½Π°Π»ΡΠ½ΠΎΠ΅ ΠΏΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠ΅. ΠΠ»Π°ΡΡ ΡΠ½Π°ΡΠ»Π΅Π΄ΠΎΠ²Π°Π½ ΠΎΡ \yii\behaviors\SluggableBehavior
ΠΏΡΠΎΡΡΠΎ ΠΏΠ΅ΡΠ΅ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ ΠΌΠ΅ΡΠΎΠ΄ generateSlug, (*8)
use zabachok\behaviors\SluggableBehavior;
public function behaviors()
{
return [
[
'class' => SluggableBehavior::className(),
'attribute' => 'title',
// 'slugAttribute' => 'slug',
],
];
}