jdecool / image-workshop-bundle
该包已被废弃,不再维护。未建议替代包。
为ImageWorkshop实现Symfony2的bundle
1.0.0
2016-02-27 13:03 UTC
Requires
- php: >=5.3.0
- sybio/image-workshop: ^2.0
- symfony/symfony: ^2.3|^3.0
Requires (Dev)
- atoum/atoum: ~2.0
- atoum/stubs: ~2.0
This package is not auto-updated.
Last update: 2020-01-24 15:34:36 UTC
README
Symfony2 bundle实现ImageWorkshop
安装
使用composer安装该bundle
{ "require": { "jdecool/image-workshop-bundle": "~1.0" } }
在应用的AppKernel
中启用扩展
<?php public function registerBundles() { $bundles = [ // ... new JDecool\Bundle\ImageWorkshopBundle\ImageWorkshopBundle(), ]; // ... return $bundles; }
## Twig过滤器
<img src="{{ 'path/to/image/file.png'|image_filter('image_format') }}">
配置参考
image_workshop: cache: lifetime: 86400 # 1 day prefix: media/cache formats: ~
图像格式定义
image_workshop: cache: lifetime: 86400 # 1 day prefix: media/cache formats: thumbnail: width: 200 height: 300 profile: width: 500 height: 500