inspirenmy / yii2-nivo-slider
为 Yii2 的 Nivo 滑块小部件
    dev-master
    2018-01-26 11:38 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-20 21:07:00 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 ], ]);