示例#1
0
 public function behaviors()
 {
     return [TimestampBehavior::className(), BlameableBehavior::className(), DateTimeBehavior::className(), CacheBehavior::className(), ['class' => AdminLogBehavior::className(), 'titleAttribute' => 'title', 'icon' => 'fa-bars bg-olive'], ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title', 'slug', 'description', 'content', 'image_description', 'redirect', 'meta_title', 'meta_keywords', 'meta_description'], 'translationLanguageAttribute' => 'locale'], ['class' => ImageUploadBehavior::className(), 'attribute' => 'image', 'defaultImage' => '/images/no_image.png', 'thumbs' => ['small' => ['width' => 150, 'height' => 100], 'big' => ['width' => 450, 'height' => 150]], 'filePath' => '@frontend/web/uploads/news/[[id_path]]/[[pk]].[[extension]]', 'fileUrl' => '/uploads/news/[[id_path]]/[[pk]].[[extension]]', 'thumbPath' => '@frontend/web/uploads/news/[[id_path]]/[[profile]]_[[pk]].[[extension]]', 'thumbUrl' => '/uploads/news/[[id_path]]/[[profile]]_[[pk]].[[extension]]'], ['class' => ManyToManyBehavior::className(), 'relations' => [['editableAttribute' => 'categories', 'table' => '{{%news_news_category}}', 'ownAttribute' => 'news_id', 'relatedModel' => NewsCategory::className(), 'relatedAttribute' => 'category_id', 'fillingRoute' => ['news/news/create', 'news/news/update']]]], ['class' => TaggableBehavior::className()], ['class' => GalleryBehavior::className(), 'galleryClass' => NewsGallery::className()]];
 }
示例#2
0
 public function behaviors()
 {
     return [TimestampBehavior::className(), BlameableBehavior::className(), CacheBehavior::className(), ['class' => AdminLogBehavior::className(), 'titleAttribute' => 'title', 'icon' => 'fa-flag bg-maroon'], ['class' => ImageUploadBehavior::className(), 'attribute' => 'image', 'filePath' => '@frontend/web/uploads/banner/[[pk]]/[[pk]].[[extension]]', 'fileUrl' => '/uploads/banner/[[pk]]/[[pk]].[[extension]]'], ['class' => DateTimeBehavior::className(), 'attributes' => [BaseActiveRecord::EVENT_BEFORE_INSERT => ['date_start', 'date_end'], BaseActiveRecord::EVENT_BEFORE_UPDATE => ['date_start', 'date_end'], BaseActiveRecord::EVENT_AFTER_FIND => ['date_start', 'date_end']], 'format' => 'datePHPFormat']];
 }
示例#3
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [TimestampBehavior::className(), ['class' => AdminLogBehavior::className(), 'titleAttribute' => 'email', 'icon' => 'fa-user bg-blue'], ['class' => ImageUploadBehavior::className(), 'attribute' => 'image', 'defaultImage' => '/images/avatar.jpg', 'thumbs' => ['avatar' => ['width' => 100, 'height' => 100]], 'filePath' => '@frontend/web/uploads/users/[[pk]]/[[pk]].[[extension]]', 'fileUrl' => '/uploads/users/[[pk]]/[[pk]].[[extension]]', 'thumbPath' => '@frontend/web/uploads/users/[[pk]]/[[profile]]_[[pk]].[[extension]]', 'thumbUrl' => '/uploads/users/[[pk]]/[[profile]]_[[pk]].[[extension]]']];
 }
示例#4
0
 public function behaviors()
 {
     return [TimestampBehavior::className(), BlameableBehavior::className(), ['class' => PositionBehavior::className(), 'parentIdAttribute' => 'slider_id'], CacheBehavior::className(), ['class' => AdminLogBehavior::className(), 'titleAttribute' => 'title', 'icon' => 'fa-sliders bg-tan'], ['class' => ImageUploadBehavior::className(), 'attribute' => 'image', 'thumbs' => ['slide' => ['width' => 1400, 'height' => 730]], 'filePath' => '@frontend/web/uploads/slide/[[pk]]/[[pk]].[[extension]]', 'fileUrl' => '/uploads/slide/[[pk]]/[[pk]].[[extension]]', 'thumbPath' => '@frontend/web/uploads/slide/[[pk]]/[[profile]]_[[pk]].[[extension]]', 'thumbUrl' => '/uploads/slide/[[pk]]/[[profile]]_[[pk]].[[extension]]'], ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title', 'description', 'link'], 'translationLanguageAttribute' => 'locale'], ['class' => SortableGridBehavior::className(), 'sortableAttribute' => 'position']];
 }
示例#5
0
 public function behaviors()
 {
     return [['class' => ImageUploadBehavior::className(), 'attribute' => 'image', 'tabularAttribute' => 'gallery_id', 'source' => 'GalleryFilesSources', 'thumbs' => ['small' => ['width' => 150, 'height' => 100], 'big' => ['width' => 450, 'height' => 150]], 'filePath' => '@frontend/web/uploads/news_gallery/[[id_path]]/[[pk]].[[extension]]', 'fileUrl' => '/uploads/news_gallery/[[id_path]]/[[pk]].[[extension]]', 'thumbPath' => '@frontend/web/uploads/news_gallery/[[id_path]]/[[profile]]_[[pk]].[[extension]]', 'thumbUrl' => '/uploads/news_gallery/[[id_path]]/[[profile]]_[[pk]].[[extension]]'], ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['image_text'], 'translationLanguageAttribute' => 'locale']];
 }