amilna / yii2-nivo-slider
Yii2 的 Nivo 滑块小部件
dev-master
2015-10-04 03:25 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-28 18:47:43 UTC
README
为 Yii2 提供可定制的 nivo 滑块插件。
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
php composer.phar require "amilna/yii2-nivo-slider" "*"
或者
"amilna/yii2-nivo-slider" : "*"
将以下内容添加到您应用程序 composer.json
文件的 require 部分。
由于此扩展仍在开发阶段,请确保在 composer.json
文件中添加以下行。
使用方法
在视图中
use amilna\nivoslider\NivoSlider; echo NivoSlider::widget([ // active data provider or just array of image, url, title and description, exp: [["image"=>"test1.jpg","url"=>null],["image"=>"test2.jpg","url"=>null]] 'targetId'=>'nivoslider', //id of rendered nivoslider (the container will constructed by the widget with the given id) 'imageKey'=>'image', //model attribute to be used as background 'theme' => 'default', //available themes: default, bar, dark, light 'css' => '', // url of css to overide default css relative from @web // example to overide default options more options on http://docs.dev7studios.com/jquery-plugins/nivo-slider 'options'=>[ 'effect'=> 'boxRandom', 'manualAdvance'=>false, 'controlNav'=> false ], ]);