File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,11 @@ Slug comes with the following configuration options:
8080- ` unique: ` : tells if slugs should be unique. Set this to a callable if you
8181 want to customize how unique slugs are generated. Defaults to ` true ` .
8282- ` scope ` : extra conditions used when checking a slug for uniqueness.
83- - ` implementedEvents ` : events this behavior listens to.
83+ - ` implementedEvents ` : events this behavior listens to. Defaults to
84+ ` ['Model.buildValidator' => 'buildValidator', 'Model.beforeSave' => 'beforeSave'] ` .
85+ By default the behavior adds validation for the ` displayField ` fields to make
86+ them required on record creating. If you don't want these auto added validations
87+ you can set ` implementedEvents ` to just ` ['Model.beforeSave' => 'beforeSave'] ` .
8488- ` onUpdate ` : Boolean indicating whether slug should be updated when updating
8589 record, defaults to ` false ` .
8690
Original file line number Diff line number Diff line change @@ -35,7 +35,12 @@ class SlugBehavior extends Behavior
3535 * - unique: Tells if slugs should be unique. Set this to a callable if you
3636 * want to customize how unique slugs are generated. Defaults to `true`.
3737 * - scope: Extra conditions used when checking a slug for uniqueness.
38- * - implementedEvents: Events this behavior listens to.
38+ * - implementedEvents: Events this behavior listens to. Defaults to
39+ * `['Model.buildValidator' => 'buildValidator', 'Model.beforeSave' => 'beforeSave']`.
40+ * By default the behavior adds validation for the `displayField` fields
41+ * to make them required on record creating. If you don't want these auto
42+ * added validations you can set `implementedEvents` to just
43+ * `['Model.beforeSave' => 'beforeSave']`.
3944 * - onUpdate: Boolean indicating whether slug should be updated when
4045 * updating record, defaults to `false`.
4146 *
You can’t perform that action at this time.
0 commit comments