Browse Source

SluggableBehavior phpDoc added

tags/2.0.0-rc
Alexander Kochetov 10 years ago
parent
commit
031c9cca06
  1. 18
      framework/behaviors/SluggableBehavior.php

18
framework/behaviors/SluggableBehavior.php

@ -12,7 +12,23 @@ use yii\db\BaseActiveRecord;
use yii\helpers\Inflector;
/**
* SluggableBehavior
* SluggableBehavior automatically fills the specified attribute with the transliteration result of other attribute.
*
* To use SluggableBehavior, simply insert the following code to your ActiveRecord class:
*
* ```php
* use yii\behaviors\SluggableBehavior;
*
* public function behaviors()
* {
* return [
* [
* 'class' => 'SluggableBehavior::className(),
* 'attribute' => 'title',
* ],
* ];
* }
* ```
*
* @author Alexander Kochetov <creocoder@gmail.com>
* @since 2.0

Loading…
Cancel
Save