Exemple #1
0
 public function behaviors()
 {
     return ['translateRelations' => ['class' => TranslateBehavior::className()], 'translate' => ['class' => TranslateableBehavior::className(), 'relation' => 'translates', 'languageField' => 'lang', 'translationAttributes' => ['title']]];
 }
Exemple #2
0
 public function behaviors()
 {
     return ['trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['content']]];
 }
Exemple #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']]];
 }
 /**
  * @return array
  */
 public function behaviors()
 {
     return ['trans' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title', 'description']]];
 }
Exemple #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']]]);
 }
Exemple #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']]];
 }
Exemple #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']];
 }
Exemple #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']]];
 }