farawayslv / yii2-gallery
以自定义文件夹作为源头的图片画廊
dev-master
2019-12-01 06:48 UTC
This package is auto-updated.
Last update: 2024-09-29 05:35:45 UTC
README
以自定义文件夹作为源或图片URL数组创建图片画廊。使用bootstrap 4,lightbox和jQuery。
安装
安装此扩展的首选方法是通过 composer。
运行以下命令之一:
php composer.phar require --prefer-dist farawayslv/yii2-gallery "*"
或者
"farawayslv/yii2-gallery": "*"
将以下内容添加到您的 composer.json
文件的require部分。
使用方法
扩展安装完成后,只需在您的代码中使用它即可
<?= \farawayslv\gallery\Gallery::widget([ 'title' => (string) Gallery title. Optional, 'description' => (string) Gallery description. Optional, 'source' => (string) Path to images folder. (or set files directly), 'files' => (Array[string]) Images urls (if not defined source parameter). Optional, 'inRow' => (Integer) How many images in each row. optional, 'isDeep' => (Bool) If "true" we get images not only source root directory, but and in all child directories, 'emptyMessage' => (String) If have no images default message. Optional, 'pageSize' => (Integer) How many images will be show on one page. Optional, 'imageClass' => (String) Custom class for images. Optional, 'imageWrapClass' => (String) Custom class for images containers. Optional, 'pagerOptions' => (Array) Standart LinkPager options (see Yii2 docs). Optional ]); ?>```