2017 © Pedro Peláez
 

bsd-3-clause yii2-imagable

Image saving extension for yii2

image

yiimaker/yii2-imagable

Image saving extension for yii2

  • Tuesday, February 28, 2017
  • by YiiMaker
  • Repository
  • 2 Watchers
  • 2 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Instalation

php composer.phar require yiimaker/yii2-imagable

or add, (*1)

"yiimaker/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' => 'ymaker\imagable\Imagable',
    'imageClass' => 'ymaker\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

28/02 2017

dev-master

9999999-dev

Image saving extension for yii2

  Sources   Download

The Requires

 

The Development Requires

by Ruslan Saiko

yii2 image thumbnail save

09/01 2017

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

04/12 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