public function behaviors()
 {
     return [TimestampBehavior::className(), ['class' => UploadBehavior::className(), 'attribute' => 'image', 'pathAttribute' => 'path', 'baseUrlAttribute' => 'base_url', 'typeAttribute' => 'type'], 'cacheInvalidate' => ['class' => CacheInvalidateBehavior::className(), 'cacheComponent' => 'frontendCache', 'keys' => [function ($model) {
         return [WidgetCarousel::className(), $model->carousel->key];
     }]]];
 }
예제 #2
0
 public function behaviors()
 {
     return ['cacheInvalidate' => ['class' => CacheInvalidateBehavior::className(), 'keys' => [function ($model) {
         return [self::className(), $model->key];
     }]]];
 }
예제 #3
0
 public function behaviors()
 {
     return ['cacheInvalidate' => ['class' => CacheInvalidateBehavior::className(), 'cacheComponent' => 'frontendCache', 'keys' => [function ($model) {
         return [get_class($model), $model->key];
     }]]];
 }
예제 #4
0
 public function behaviors()
 {
     return [TimestampBehavior::className(), ['class' => UploadBehavior::className(), 'attribute' => 'image'], 'cacheInvalidate' => ['class' => CacheInvalidateBehavior::className(), 'keys' => [function ($model) {
         return [WidgetCarousel::className(), $model->carousel->key];
     }]]];
 }