c33s / simple-gallery-bundle
此包已被 弃用 且不再维护。未建议替代包。
为 Symfony2 设计的简单即插即用 propel / admingenerator 图库
v0.2.1
2015-05-25 13:31 UTC
Requires
- php: >=5.3.3
- c33s/attachment-bundle: ~0.5
- propel/propel-bundle: ~1.2
This package is not auto-updated.
Last update: 2019-07-29 15:17:11 UTC
README
为 Symfony2 设计的简单即插即用 propel / admingenerator 图库
这是一个正在进行中的工作!请自行承担风险使用!
快速文档
- 安装
- 添加到 appkernel
- 启用 admingenerator
fixtures.yml
C33s\SimpleGalleryBundle\Model\Gallery:
background:
title: Background
slug: background
is_listed: false
ImagesLoadFromDirectory: app/propel/attachments/Gallery/background
ImageFilePath: app/propel/attachments/Gallery/background/gallery-avatar.jpg
twig
简单示例
<ul>
{% for item in single_gallery('GallerySlug').galleryItems %}
<li><img src="{{ item.image|att_url('liip_imagine_filter_name') }}"></li>
{% endfor %}
</ul>
带有 vegas 滑块的示例
$(function() {
$.vegas('slideshow', {
delay: 5000,
backgrounds: [{% spaceless %}
{% for item in single_gallery('background').galleryItems %}
{ src: '{{ item.image|att_url('header') }}', fade: 1000 }{% if not loop.last %},{% endif %}
{% endfor %}
{% endspaceless %}]
})('overlay', {
src: '{% image 'media/components/vegas/dist/overlays/06.png' %}{{ asset_url }}{% endimage %}'
});
});