Created
August 17, 2015 16:03
-
-
Save nsanden/eabb8335490acd6bb5a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionTest() | |
{ | |
$n = new \common\models\Campaign; | |
$n->url = 'blargh'; | |
$n->save(false); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function behaviors() | |
{ | |
return [ | |
'timestamp' => [ | |
'class' => TimestampBehavior::className(), | |
], | |
[ | |
'class' => \yii\behaviors\SluggableBehavior::className(), | |
'attribute' => 'url', | |
'slugAttribute' => 'slug', | |
'immutable' => true, | |
'ensureUnique'=>true, | |
], | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment