quattrozeta-org/yii2-gallery-widget
Composer 安装命令:
composer require quattrozeta-org/yii2-gallery-widget
包简介
Blueimp gallery widget for the Yii framework
README 文档
README
Renders a BlueImp Gallery and/or Carousel. BlueImp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading and can be extended to display additional.
For more information, please visit http://blueimp.github.io/Gallery/
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require 2amigos/yii2-gallery-widget:~1.0
or add
"2amigos/yii2-gallery-widget": "~1.0"
to the require section of your composer.json file.
Usage
Using Gallery With LightBox
// on your view
<?php $items = [
[
'url' => 'http://farm8.static.flickr.com/7429/9478294690_51ae7eb6c9_b.jpg',
'src' => 'http://farm8.static.flickr.com/7429/9478294690_51ae7eb6c9_s.jpg',
'options' => array('title' => 'Camposanto monumentale (inside)')
],
[
'url' => 'http://farm3.static.flickr.com/2863/9479121747_0b37c63fe7_b.jpg',
'src' => 'http://farm3.static.flickr.com/2863/9479121747_0b37c63fe7_s.jpg',
'options' => array('title' => 'Hafsten - Sunset')
],
[
'url' => 'http://farm4.static.flickr.com/3712/9478186779_81c2e5f7ef_b.jpg',
'src' => 'http://farm4.static.flickr.com/3712/9478186779_81c2e5f7ef_s.jpg',
'options' => array('title' => 'Sail us to the Moon')
],
[
'url' => 'http://farm4.static.flickr.com/3789/9476654149_b4545d2f25_b.jpg',
'src' => 'http://farm4.static.flickr.com/3789/9476654149_b4545d2f25_s.jpg',
'options' => array('title' => 'Sail us to the Moon')
],
[
'url' => 'http://farm8.static.flickr.com/7429/9478868728_e9109aff37_b.jpg',
'src' => 'http://farm8.static.flickr.com/7429/9478868728_e9109aff37_s.jpg',
'options' => array('title' => 'Sail us to the Moon')
],
[
'url' => 'http://farm4.static.flickr.com/3825/9476606873_42ed88704d_b.jpg',
'src' => 'http://farm4.static.flickr.com/3825/9476606873_42ed88704d_s.jpg',
'options' => array('title' => 'Sail us to the Moon')
],
[
'url' => 'http://farm4.static.flickr.com/3749/9480072539_e3a1d70d39_b.jpg',
'src' => 'http://farm4.static.flickr.com/3749/9480072539_e3a1d70d39_s.jpg',
'options' => array('title' => 'Sail us to the Moon')
],
[
'url' => 'http://farm8.static.flickr.com/7352/9477439317_901d75114a_b.jpg',
'src' => 'http://farm8.static.flickr.com/7352/9477439317_901d75114a_s.jpg',
'options' => array('title' => 'Sail us to the Moon')
],
[
'url' => 'http://farm4.static.flickr.com/3802/9478895708_ccb710cfd1_b.jpg',
'src' => 'http://farm4.static.flickr.com/3802/9478895708_ccb710cfd1_s.jpg',
'options' => array('title' => 'Sail us to the Moon')
],
];?>
<?= dosamigos\gallery\Gallery::widget(['items' => $items]);?>
// ...
Using Carousel With Json Encoded Items
// on your view
<?php $items = [
[
'title' => 'Sintel',
'href' => 'http://media.w3.org/2010/05/sintel/trailer.mp4',
'type' => 'video/mp4',
'poster' => 'http://media.w3.org/2010/05/sintel/poster.png'
],
[
'title' => 'Big Buck Bunny',
'href' => 'http://upload.wikimedia.org/wikipedia/commons/7/75/Big_Buck_Bunny_Trailer_400p.ogg',
'type' => 'video/ogg',
'poster' => 'http://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Big.Buck.Bunny.-.Opening.Screen.png/' .
'800px-Big.Buck.Bunny.-.Opening.Screen.png'
],
[
'title' => 'Elephants Dream',
'href' => 'http://upload.wikimedia.org/wikipedia/commons/transcoded/8/83/Elephants_Dream_%28high_quality%29.ogv/' .
'Elephants_Dream_%28high_quality%29.ogv.360p.webm',
'type' => 'video/webm',
'poster' => 'http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Elephants_Dream_s1_proog.jpg/' .
'800px-Elephants_Dream_s1_proog.jpg'
],
[
'title' => 'LES TWINS - An Industry Ahead',
'href' => 'http://www.youtube.com/watch?v=zi4CIXpx7Bg',
'type' => 'text/html',
'youtube' => 'zi4CIXpx7Bg',
'poster' => 'http://img.youtube.com/vi/zi4CIXpx7Bg/0.jpg'
],
[
'title' => 'KN1GHT - Last Moon',
'href' => 'http://vimeo.com/73686146',
'type' => 'text/html',
'vimeo' => '73686146',
'poster' => 'http://b.vimeocdn.com/ts/448/835/448835699_960.jpg'
]
];?>
<?= dosamigos\gallery\Carousel::widget([
'items' => $items, 'json' => true,
'clientEvents' => [
'onslide' => 'function(index, slide) {
console.log(slide);
}'
]]);
// ...
Multiple Carousel instances on one page
// on your view
<?php $items = [
[
'title' => 'Sintel',
'href' => 'http://media.w3.org/2010/05/sintel/trailer.mp4',
'type' => 'video/mp4',
'poster' => 'http://media.w3.org/2010/05/sintel/poster.png'
],
[
'title' => 'Big Buck Bunny',
'href' => 'http://upload.wikimedia.org/wikipedia/commons/7/75/Big_Buck_Bunny_Trailer_400p.ogg',
'type' => 'video/ogg',
'poster' => 'http://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Big.Buck.Bunny.-.Opening.Screen.png/' .
'800px-Big.Buck.Bunny.-.Opening.Screen.png'
],
[
'title' => 'Elephants Dream',
'href' => 'http://upload.wikimedia.org/wikipedia/commons/transcoded/8/83/Elephants_Dream_%28high_quality%29.ogv/' .
'Elephants_Dream_%28high_quality%29.ogv.360p.webm',
'type' => 'video/webm',
'poster' => 'http://upload.wikimedia.org/wikipedia/commons/thumb/9/90/Elephants_Dream_s1_proog.jpg/' .
'800px-Elephants_Dream_s1_proog.jpg'
]
];?>
<?= dosamigos\gallery\Carousel::widget([
'items' => $items, 'json' => true,
'templateOptions' => ['id'=>'gallery_1'],
'clientOptions' => ['container'=>'#gallery_1'],
'options' => ['id'=>'gallery_1'],
]);
<?= dosamigos\gallery\Carousel::widget([
'items' => $items, 'json' => true,
'templateOptions' => ['id'=>'gallery_2'],
'clientOptions' => ['container'=>'#gallery_2'],
'options' => ['id'=>'gallery_2'],
]);
?>
You can access to different instances in JS now
blueimp_galleries['gallery_1'].initSlides();
blueimp_galleries['gallery_1'].next();
Testing
$ ./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The BSD License (BSD). Please see License File for more information.
web, mobile development & design
www.2amigos.us
quattrozeta-org/yii2-gallery-widget 适用场景与选型建议
quattrozeta-org/yii2-gallery-widget 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「gallery」 「yii」 「widget」 「yii2」 「yii 2」 「2amigos」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 quattrozeta-org/yii2-gallery-widget 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 quattrozeta-org/yii2-gallery-widget 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 quattrozeta-org/yii2-gallery-widget 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
A module for the SilverStripe CMS which allows you to organize images in a gallery format.
Creates a basic photo gallery pagetype with albums and photos. Photos within albums are opened with a lightbox.
Quick gallery content block for Silverstripe CMS
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
Simple gallery using FileCollections.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2025-12-23