Example #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];
     }]]);
 }