wucdbm / gallery-bundle
一个用于Symfony 2应用程序的相册组件,允许您将文件上传到多个位置并在数据库中跟踪它们。
v3.2.3
2016-07-24 17:59 UTC
Requires
- php: ~5.5|~7.0
- symfony/symfony: ~2.8|~3.0
- wucdbm/wucdbm-bundle: ~3.0
README
一个简单的相册组件,允许您上传图片,裁剪它们并将它们的引用保存到数据库中。
示例配置
此配置假设您的 http://some.host
指向 /home/user/project/uploads/public
,并且已正确配置为公开访问
parameters.yml
parameters:
uploads.root: /home/user/project/uploads
uploads.host: 'http://some.host'
config.yml
parameters:
revision: 1
uploads.temp: %uploads.root%/temp
uploads.public: %uploads.root%/public
# Private is not used in this example, but you could point your webserver to index the public one
# and have private files in the private and only serve them via symfony after authentication
uploads.private: %uploads.root%/private
wucdbm_gallery:
configs:
articles:
path: '%uploads.public%/articles'
host: '%uploads.host%/articles/%%s?v=%revision%'
temp: '%uploads.public%/temp/articles'
name: Articles
products:
path: '%uploads.public%/products/images'
# Please notice th double percent sign in %%s?v - the first percent escapes the second
# the %s is being replaced with the image relative path via sprintf() in the ImageManager
host: '%uploads.host%/products/images/%%s?v=%revision%'
temp: '%uploads.public%/temp/images/products'
name: Products
defaults:
ratio: banner
size: banner
aspect_ratios:
frontpage:
width: 17
height: 9
banner:
width: 300
height: 250
sizes:
frontpage:
width: 1700
height: 900
banner:
width: 300
height: 250