mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
\yii\behaviors\SluggableBehavior updated
This commit is contained in:
committed by
Qiang Xue
parent
4c20b57b98
commit
c7b51e2565
@ -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 <creocoder@gmail.com>
|
||||
* @since 2.0
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user