hypejunction/cropper
最新稳定版本:7.0.0
Composer 安装命令:
composer require hypejunction/cropper
包简介
Cropper form input for Elgg
README 文档
README
Responsive image cropping input for Elgg
Usage
Add cropper as a form input
echo elgg_view('input/cropper', array( 'src' => 'http://example.com/uri/image.jpg', 'ratio' => 16/9, 'name' => 'crop_coords', ));
Add cropper to a file input (basic usage)
// in your form echo elgg_view('input/file', array( 'name' => 'avatar', 'use_cropper' => true, )); // in your action $coords = get_input('crop_coords');
Add cropper to a file input (advanced usage)
// in your form echo elgg_view('input/file', array( 'name' => 'cover', 'use_cropper' => array( 'name' => 'cover_crop_coords', 'ratio' => 16/9, 'src' => '/uri/image.jpg', // previously uploaded file 'x1' => 100, 'y1' => 100, 'x2' => 260, 'y2' => 190, ), )); // in your action $coords = get_input('cover_crop_coords');
Notes
- In your action, be sure to use the same image source for cropping. If you passed master image source to the file input, you will need to implement the logic for both new file upload and master image, as cropping coordinates may change even without new file upload.
Compatibility
| Plugin version | Elgg version |
|---|---|
| 7.0.0 | 7.x |
| 6.0.0 | 6.x |
| 5.0.0 | 5.x |
| 4.0.0 | 4.x |
| 3.0.0 | 3.x |
统计信息
- 总下载量: 89
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2015-12-04