yiimaker/yii2-imagable
最新稳定版本:1.0.1
Composer 安装命令:
composer require yiimaker/yii2-imagable
包简介
Image saving extension for yii2
关键字:
README 文档
README
#Instalation
php composer.phar require yiimaker/yii2-imagable
or add
"yiimaker/yii2-imagable": "*"
to the require section of your composer.json.
#Confiugation
After extension is installed you need to setup imagable application component:
'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']; } //... }
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-11-28