Example #1
0
 public function behaviors()
 {
     return ['translateRelations' => ['class' => TranslateBehavior::className()], 'translate' => ['class' => TranslateableBehavior::className(), 'relation' => 'translates', 'languageField' => 'lang', 'translationAttributes' => ['title']]];
 }
Example #2
0
 public function behaviors()
 {
     return ['trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['content']]];
 }
Example #3
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [TimestampBehavior::className(), SettingModel::className(), ['class' => BlameableBehavior::className(), 'createdByAttribute' => 'create_user_id', 'updatedByAttribute' => 'update_user_id'], ['class' => SluggableBehavior::className(), 'attribute' => 'title', 'slugAttribute' => 'slug'], ['class' => \mongosoft\file\UploadImageBehavior::className(), 'attribute' => 'image', 'scenarios' => ['insert', 'update'], 'placeholder' => '@webroot/uploads/user/non_image.png', 'createThumbsOnSave' => true, 'path' => '@webroot/uploads/news/{id}', 'url' => '@web/uploads/news/{id}', 'thumbPath' => '@webroot/uploads/news/{id}/thumb', 'thumbUrl' => '@web/uploads/news/{id}/thumb', 'thumbs' => ['thumb' => ['width' => 340, 'quality' => 100, 'mode' => 'outbound']]], 'trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['slug', 'title', 'description', 'content', 'link', 'meta_title', 'meta_keywords', 'meta_description', 'settings']]];
 }
Example #4
0
 /**
  * @return array
  */
 public function behaviors()
 {
     return ['trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title', 'description']]];
 }
Example #5
0
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () {
         return time();
     }], 'trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['alt', 'title', 'subtitle', 'description', 'url']]]);
 }
Example #6
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [TimestampBehavior::className(), SettingModel::className(), ['class' => SluggableBehavior::className(), 'attribute' => 'title_h1', 'slugAttribute' => 'slug'], ['class' => \mongosoft\file\UploadImageBehavior::className(), 'attribute' => 'background_image', 'scenarios' => ['insert', 'update'], 'placeholder' => '@webroot/uploads/user/non_image.png', 'createThumbsOnSave' => true, 'path' => '@webroot/uploads/background_image/category_{id}', 'url' => '@web/uploads/background_image/category_{id}'], 'trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['slug', 'title', 'subtitle', 'title_h1', 'content', 'description', 'meta_title', 'meta_keywords', 'meta_description', 'settings']]];
 }
Example #7
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return parent::behaviors() + [TimestampBehavior::className(), ['class' => SluggableBehavior::className(), 'attribute' => 'title', 'immutable' => true], 'trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['slug', 'title', 'content', 'meta_title', 'meta_keywords', 'meta_description', 'settings']]];
 }
 /**
  * @return array
  */
 public function behaviors()
 {
     return ['trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title', 'description', 'position', 'period']], ['class' => UploadBehavior::className(), 'attribute' => 'image', 'pathAttribute' => 'image_path', 'baseUrlAttribute' => 'image_base_url', 'typeAttribute' => 'image_type']];
 }
Example #9
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [['class' => SettingModel::className(), 'settingsField' => 'settings', 'module' => false], ['class' => SluggableBehavior::className(), 'attribute' => 'title', 'slugAttribute' => 'slug'], 'trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title', 'subtitle', 'text', 'settings']], 'sort' => ['class' => SortableGridBehavior::className(), 'sortableAttribute' => 'order']];
 }
 /**
  * @return array
  */
 public function behaviors()
 {
     return ['trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['name', 'content']], 'timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () {
         return time();
     }], 'tree' => ['class' => NestedSetsBehavior::className(), 'treeAttribute' => 'root', 'depthAttribute' => 'level']];
 }
 /**
  * @return array
  */
 public function behaviors()
 {
     return [['class' => UploadBehavior::className(), 'attribute' => 'flag', 'pathAttribute' => 'flag_path', 'baseUrlAttribute' => 'flag_base_url', 'typeAttribute' => 'flag_type'], 'trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['name']]];
 }