Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return \yii\helpers\ArrayHelper::merge(parent::behaviors(), ['translateable' => ['class' => \creocoder\translateable\TranslateableBehavior::className(), 'translationAttributes' => static::getTranslationAttributes()], 'timestamp' => ['class' => \yii\behaviors\TimestampBehavior::className()], 'sitemap' => ['class' => SitemapBehavior::className(), 'scope' => function ($model) {
         /** @var \yii\db\ActiveQuery $model */
         $model->andWhere(['published' => 1]);
     }, 'dataClosure' => function ($model) {
         /** @var self $model */
         return ['loc' => Url::to($model->getViewUrl(), true), 'lastmod' => $model->updated_at, 'changefreq' => SitemapBehavior::CHANGEFREQ_WEEKLY, 'priority' => 0.8];
     }]]);
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['title', 'body']]];
 }
 public function behaviors()
 {
     return ['translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['name', 'params']], 'timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () {
         return time();
     }]];
 }
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['to', 'bcc', 'from', 'subject', 'message']], 'timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () {
         return time();
     }]]);
 }
Exemplo n.º 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();
     }], 'translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['alt', 'title', 'subtitle', 'description', 'link']]]);
 }
 /**
  * @return array
  */
 public function behaviors()
 {
     return ['translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['name', 'description', 'slug']], 'timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () {
         return time();
     }], 'image' => ['class' => 'infoweb\\cms\\behaviors\\ImageBehave'], 'sortable' => ['class' => Sortable::className(), 'orderAttribute' => ['position']]];
 }
Exemplo n.º 7
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return \yii\helpers\ArrayHelper::merge(parent::behaviors(), ['translateable' => ['class' => \creocoder\translateable\TranslateableBehavior::className(), 'translationAttributes' => static::getTranslationAttributes()], 'timestamp' => ['class' => \yii\behaviors\TimestampBehavior::className()]]);
 }
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['name', 'title', 'content']], 'timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () {
         return time();
     }], 'homepage' => ['class' => HomepageBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => 'homepage', ActiveRecord::EVENT_BEFORE_UPDATE => 'homepage']], 'seo' => ['class' => SeoBehavior::className(), 'titleAttribute' => 'title'], 'image' => ['class' => 'infoweb\\cms\\behaviors\\ImageBehave']]);
 }
Exemplo n.º 9
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return ['timestamp' => ['class' => 'yii\\behaviors\\TimestampBehavior', 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']]], 'translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['name', 'content']]];
 }