zhangjian180 / yii2-carousel
为 Yii 2 框架的 Bootstrap 轮播小部件
dev-master
2018-08-06 10:15 UTC
Requires
- yiisoft/yii2: ~2.0.0
This package is not auto-updated.
Last update: 2024-09-21 14:17:55 UTC
README
支持单个或多个(列表)多图轮播展示小部件
安装
安装此扩展的首选方式是通过 composer。
运行以下命令:
php composer.phar require --prefer-dist zhangjian180/yii2-carousel "*"
或将其添加到 composer.json 文件的 require 部分:
"zhangjian180/yii2-carousel": "*"
使用
一旦安装了扩展,只需在代码中使用它即可:
<?= \zhangjian180\carousel\Carousel::widget([ 'imagesData' => ['http://...01.png', 'http://...02.png'], 'imagesConfig' => [ 'width' => '104', 'height' => '40' ], /* 默认图 */ 'defaultDataSrc' => 'holder.js/104x40', 'myCarouselIdName' => 'myCarousel', 'myCarouselStyle' => 'width:104px !important; margin:0 auto;' ]); ?>```