From c7b51e256578c890997e64863db6831e67eb286f Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Thu, 19 Jun 2014 02:58:45 +0400 Subject: [PATCH] \yii\behaviors\SluggableBehavior updated --- framework/behaviors/SluggableBehavior.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/framework/behaviors/SluggableBehavior.php b/framework/behaviors/SluggableBehavior.php index c55f46d219..b74f3173ea 100644 --- a/framework/behaviors/SluggableBehavior.php +++ b/framework/behaviors/SluggableBehavior.php @@ -31,6 +31,21 @@ use yii\helpers\Inflector; * } * ``` * + * By default, SluggableBehavior will fill the `slug` attribute with a value that can be used a slug in a URL + * when the associated AR object is being validated. If your attribute name is different, you may configure + * the [[slugAttribute]] property like the following: + * + * ```php + * public function behaviors() + * { + * return [ + * [ + * 'class' => SluggableBehavior::className(), + * 'slugAttribute' => 'alias', + * ], + * ]; + * } + * ``` * @author Alexander Kochetov * @since 2.0 */