I have configured Sluggable behavior on my model as follows:
public function behaviors() {
return [
[
'class' => SluggableBehavior::className(),
'attribute' => 'title',
'ensureUnique' => true,
]
];
}
I need to do:
- If the user fills a form field called "URL", this should be used instead of the automatic generated slug.
- If user changes the title, they will mark a checkbox if they want the slug updated.
I have found that Sluggable Behaviour has an attribute "immutable" but I do not see a method to manipulate it.
Also I do not see a way to stop automatic generation if value is given.
Any ideas?