elendev/image-bundle
Composer 安装命令:
composer require elendev/image-bundle
包简介
Provide simple image utilities for resizing
关键字:
README 文档
README
Bundle configuration
elendev_image:
cache_dir: 'path_to_cache_directory'
source_dir: 'path_to_image_dir'
cache_url: 'url/to/cache/dir'
The cache_dir configuration key is the local path to the cache directory. It's the directory where the generated files will be stored (for example : /var/www/my-website/media/cache).
The source_dir configuration key is the local path to the directory containing the images (for example : /var/www/my-website/media/original-files).
The cache_url configuration key is the url to the cache directory. If the url http://www.my-website.com redirect to the local /var/www/my-website directory, the value of this configuration key would be http://www.my-website.com/media/cache.
Use Twig's extension image method
<img src="{{image('source')}}"/>
<img src="{{image('source').resize(200, 200)}}"/>
<img src="{{image('source').rotate(180).greyScale()}}"/>
The available methods are those of the Elendev\ElendevImageBundle\ImageProxy class :
interface ImageProxy {
...
public function resize($width, $height, $keepRatio = true, $allowEnlarge = false);
/**
* @param type $degree
* @param type $bgcolor background color for visible parts, by default black
*/
public function rotate($degree, $bgcolor = 0);
/**
* Do greyscale on picture
*/
public function greyScale();
...
}
统计信息
- 总下载量: 577
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache2
- 更新时间: 2012-09-18