Пример #1
0
 public function behaviors()
 {
     return ['timestampBehavior' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']], 'value' => function () {
         return date('U');
     }], 'uploadImageBehavior' => ['class' => UploadImageBehavior::className(), 'attributes' => ['intro_image' => ['path' => $this->module->ImagePath, 'temp_path' => $this->module->ImageTempPath, 'url' => $this->module->ImagePathPreview, 'key_folder' => 'id'], 'full_image' => ['path' => $this->module->ImagePath, 'temp_path' => $this->module->ImageTempPath, 'url' => $this->module->ImagePathPreview, 'key_folder' => 'id']]], 'uploadFileBehavior' => ['class' => MultipleUploadBehavior::className(), 'attributes' => ['attachments' => ['path' => $this->module->ImagePath, 'temp_path' => $this->module->ImageTempPath, 'url' => $this->module->ImagePathPreview, 'key_folder' => 'id'], 'gallery' => ['path' => $this->module->ImagePath, 'temp_path' => $this->module->ImageTempPath, 'url' => $this->module->ImagePathPreview, 'key_folder' => 'id', 'galleryType' => true]]], 'slagBehavior' => ['class' => SluggableBehavior::className(), 'attribute' => 'description', 'slugAttribute' => 'slug', 'ensureUnique' => true]];
 }
Пример #2
0
 public function behaviors()
 {
     return ['timestampBehavior' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']], 'value' => function () {
         return date('U');
     }], 'uploadImageBehavior' => ['class' => UploadImageBehavior::className(), 'attributes' => ['cover_page' => ['path' => $this->module->ComicsPath, 'temp_path' => $this->module->ComicsTempPath, 'url' => $this->module->ComicsPathPreview, 'key_folder' => 'id']]], 'uploadFileBehavior' => ['class' => MultipleUploadBehavior::className(), 'attributes' => ['comic_pages' => ['path' => $this->module->ComicsPath, 'temp_path' => $this->module->ComicsTempPath, 'url' => $this->module->ComicsPathPreview, 'key_folder' => 'id', 'galleryType' => true]]]];
 }