From ad1ce9e498aee97daf5ffafc2df95b77003d155f Mon Sep 17 00:00:00 2001 From: Nikolay Oleynikov Date: Fri, 10 Mar 2017 17:19:24 +0300 Subject: [PATCH] Improve sluggable behavior documentation (#13747) [skip ci] --- framework/behaviors/SluggableBehavior.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/framework/behaviors/SluggableBehavior.php b/framework/behaviors/SluggableBehavior.php index 22077b7..350be44 100644 --- a/framework/behaviors/SluggableBehavior.php +++ b/framework/behaviors/SluggableBehavior.php @@ -65,12 +65,14 @@ class SluggableBehavior extends AttributeBehavior */ public $slugAttribute = 'slug'; /** - * @var string|array the attribute or list of attributes whose value will be converted into a slug + * @var string|array|null the attribute or list of attributes whose value will be converted into a slug + * or `null` meaning that the `$value` property will be used to generate a slug. */ public $attribute; /** - * @var string|callable the value that will be used as a slug. This can be an anonymous function - * or an arbitrary value. If the former, the return value of the function will be used as a slug. + * @var callable|string|null the value that will be used as a slug. This can be an anonymous function + * or an arbitrary value or null. If the former, the return value of the function will be used as a slug. + * If `null` then the `$attribute` property will be used to generate a slug. * The signature of the function should be as follows, * * ```php