How to custom sluggable bahavior?
When the selector slugAttribute is need to unique, but the selector of unique need a condition, How to customize the uniqueness ?
How to custom sluggable bahavior?
When the selector slugAttribute is need to unique, but the selector of unique need a condition, How to customize the uniqueness ?
Sorry if didn’t understand, but you can set $ensureUnique to ensure unique value. And you can assign an anonymum function to $value to do any needed conditions.
function ($event)
{
// return slug
}
http://www.yiiframework.com/doc-2.0/yii-behaviors-sluggablebehavior.html
Ah I’v got clue, so I should use uniqueSlugGenerator callback, but do you know what is the default mechanism for this callback function ?
I wanna modifying from default mechanism
or maybe it’s more related to $uniqueValidator property, seems confusing, which best practice for my condition