Пример #1
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']];
 }
Пример #2
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()]];
 }
Пример #3
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [TimestampBehavior::className(), BlameableBehavior::className(), CacheBehavior::className(), ['class' => AdminLogBehavior::className(), 'titleAttribute' => 'title', 'icon' => 'fa-question-circle bg-aqua'], ['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'], ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title'], 'translationLanguageAttribute' => 'locale']];
 }