2017 © Pedro Peláez
 

yii2-extension yii2-imagable

Image saving extension for yii2

image

black-lamp/yii2-imagable

Image saving extension for yii2

  • Tuesday, January 3, 2017
  • by GutsVadim
  • Repository
  • 4 Watchers
  • 2 Stars
  • 334 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 10 Versions
  • 6 % Grown

The README.md

Instalation

php composer.phar install black-lamp/yii2-imagable

or add, (*1)

"black-lamp/yii2-imagable": "*"

to the require section of your composer.json., (*2)

Confiugation

After extension is installed you need to setup imagable application component:, (*3)

'imagable' => [
    'class' => 'bl\imagable\Imagable',
    'imageClass' => 'bl\imagable\instances\CreateImageImagine',
    'categories' => [
        'origin' => false,
        'category' => [
            'galery' => [
                'origin' => true,
            ],
            'galery/more' => [
                'origin' => false,
            ],
            'avatars' => [
                'size' => [
                    'big' => [
                        'width' => 1000,
                        'height' => 500,
                    ]
                ]
            ]
        ]
    ]
    ...

Usage

Create image

$imageName = \Yii::$app->imagable->create('avatars', 'pathToImage');
// Or
$imageName = \Yii::$app->imagable->createMultiply(['avatars', 'galery/more'], 'pathToImage');

Get Image

$fullPathToImage = \Yii::$app->imagable->get('avatars', 'big', $imageName);

Delete Image

$isDeleted = \Yii::$app->imagable->delete('avatars', $imageName);

Data provider

//To action
/** @var Imagable $image */
$imagable = \Yii::$app->imagable;
$imagable->dataProvider = [
    'key' => $data
];
//...

//To class
class ImageClass extends Object implements CreateImageInterface
{
    public $dataProvider;

    public function init()
    {
        parent::init(); // TODO: Change the autogenerated stub
        echo $this->dataProvider['key'];
    }

    //...
}

The Versions

03/01 2017

dev-master

9999999-dev

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

03/01 2017

v1.2.7

1.2.7.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

28/11 2016

v1.2.6

1.2.6.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

27/11 2016

v1.2.5

1.2.5.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

08/11 2016

v1.2.0

1.2.0.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

06/09 2016

1.1.1

1.1.1.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

06/09 2016

1.1.0

1.1.0.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

15/07 2016

1.0.2

1.0.2.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

13/06 2016

1.0.1

1.0.1.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

07/06 2016

1.0.0

1.0.0.0

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save