bestyii / yii2-swiper
Swiper滑块组件的Yii2扩展
6.0.0
2023-01-16 09:56 UTC
Requires
- php: >=5.4.0
- bower-asset/swiper: ^v6.0.0
- yiisoft/yii2: ~2.0
Requires (Dev)
- phpunit/phpunit: 4.8.x-dev
README
Yii2滑块组件。更多信息请查看:https://github.com/nolimits4web/Swiper/。
示例代码可以在 demos 文件夹中找到。
您还可以阅读 文档。
安装
您可以通过 Composer 来获取此扩展。
在安装之前配置Composer仓库
"repositories": {
"0": {
"type": "composer",
"url": "https://asset-packagist.org"
}
}
在终端中运行
$ php composer.phar require "bestyii/yii2-swiper" "*"
或者在您的应用程序的 composer.json
文件的 require 部分添加
"bestyii/yii2-swiper" : "*"
到
###使用
<?php /** * @var \yii\web\View $this */ use bestyii\swiper\Swiper; echo Swiper::widget( [ 'items' => [ [ 'background' => 'http://lorempixel.com/600/600/nature/1' ], [ 'background' => 'http://lorempixel.com/600/600/nature/2' ], [ 'background' => 'http://lorempixel.com/600/600/nature/3' ], [ 'background' => 'http://lorempixel.com/600/600/nature/4' ], [ 'background' => 'http://lorempixel.com/600/600/nature/5' ] ], 'behaviours' => [ 'pagination' ], 'pluginOptions' => [ 'grabCursor' => true, 'centeredSlides' => true, 'slidesPerView' => 'auto', 'effect' => 'coverflow', 'coverflow' => [ 'rotate' => 50, 'stretch' => 0, 'depth' => 100, 'modifier' => 1, 'slideShadows' => true ] ] ] );
问题
如果遇到任何问题,您可以创建 问题。
感谢您的关注。