Gallery.php 913 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\models\front;
  3. use app\forks\galleryManager\GalleryBehavior;
  4. use Yii;
  5. class Gallery extends \app\models\base\Gallery
  6. {
  7. public function behaviors()
  8. {
  9. return [
  10. 'galleryBehavior' => [
  11. 'class' => GalleryBehavior::className(),
  12. 'type' => 'post_gallery',
  13. 'extension' => 'png',
  14. 'directory' => Yii::getAlias('@webroot') . '/images/post_gallery/gallery',
  15. 'url' => Yii::getAlias('@web') . '/images/post_gallery/gallery',
  16. 'versions' => [
  17. 'small' => function ($img) {
  18. /** @var \Imagine\Image\ImageInterface $img */
  19. return $img;
  20. },
  21. 'medium' => function ($img) {
  22. return $img;
  23. },
  24. ]
  25. ]
  26. ];
  27. }
  28. }