2017 © Pedro Peláez
 

library yii-easyimages

Manage your images in AR is easy.

image

happyproff/yii-easyimages

Manage your images in AR is easy.

  • Tuesday, February 10, 2015
  • by happyproff
  • Repository
  • 1 Watchers
  • 0 Stars
  • 160 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

yii-easyimages

License, (*1)

Простая работа с изображениями для моделей. Автоматическая загрузка, генерация нужных размеров, удаление., (*2)

Использование

Добавить в composer.json зависимость:, (*3)

"happyproff/yii-easyimages": "*@dev"

Зарегистрировать компонент приложения:, (*4)

'components' => [
    ...,
    'easyImages' => [
        'class' => 'happyproff\YiiEasyImages\EasyImages',
    ],
    ...
]

В базовом AR классе или в конкретной модели использовать трейт и вызвать его метод в beforeSave():, (*5)

class MCategory extends ActiveRecord {
    use happyproff\YiiEasyImages\TEasyImage;
    ...
public function beforeSave () {
    if (!parent::beforeSave()) return false;

    if (method_exists($this, 'handleImages')) {
        $this->handleImages();
    }

    return true;
}

Определить атрибуты, которые будут использоваться для работы с изображениями и их пресеты:, (*6)

public function images () {
    return [
        'image' => [
            self::IMAGE_ORIGINAL => ['width' => 1920, 'height' => 1080, 'enabled' => false],
            self::IMAGE_FULL => ['width' => 960, 'height' => 720, 'quality' => 100],
            self::IMAGE_LIST => ['width' => 146, 'height' => 160, 'inset' => false,],
            self::IMAGE_ITEM => ['width' => 300, 'height' => 999],
        ],
    ];
}

The Versions

10/02 2015

dev-master

9999999-dev

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov

10/02 2015

0.0.7

0.0.7.0

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov

08/12 2014

0.0.6

0.0.6.0

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov

27/11 2014

0.0.5

0.0.5.0

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov

09/11 2014

0.0.4

0.0.4.0

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov

09/11 2014

0.0.3

0.0.3.0

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov

25/09 2014

0.0.2

0.0.2.0

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov

22/09 2014

0.0.1

0.0.1.0

Manage your images in AR is easy.

  Sources   Download

MIT

The Requires

 

by Stanislav Gamayunov