예제 #1
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['timestampBehavior' => ['class' => \yii\behaviors\TimestampBehavior::className()], 'fileBehavior' => ['class' => FileBehavior::className(), 'storage' => [$this, 'getStoragePath'], 'fileField' => 'image', 'imageSettings' => ['thumb1' => ['method' => 'thumbnail', 'width' => 50, 'height' => 50], 'thumb2' => ['method' => 'thumbnail', 'width' => 100, 'height' => 100], 'thumb3' => ['method' => 'thumbnail', 'width' => 200, 'height' => 200]]], 'relationViaBehavior' => ['class' => RelationViaBehavior::className(), 'relations' => ['categories']]];
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['tree' => ['class' => NestedSetsBehavior::className()], 'fileBehavior' => ['class' => FileBehavior::className(), 'storage' => [$this, 'getStoragePath'], 'fileField' => 'image', 'imageSettings' => ['thumb1' => ['method' => 'thumbnail', 'width' => 50, 'height' => 50], 'thumb2' => ['method' => 'thumbnail', 'width' => 100, 'height' => 100], 'thumb3' => ['method' => 'thumbnail', 'width' => 200, 'height' => 200]]]];
 }