-
Notifications
You must be signed in to change notification settings - Fork 1
/
SequenceJs.php
executable file
·75 lines (71 loc) · 2.03 KB
/
SequenceJs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
* @copyright Copyright © Amilna, amilna.net, 2015
* @package yii2-yap
*/
namespace amilna\yap;
/**
* Widget renders a Sequence JS widget.
*
* For example:
*
* ```php
* use amilna\yap\SequenceJs;
* echo SequenceJs::widget([
* 'dataProvider'=>$dataProvider, // active data provider
* 'targetId'=>'sequence', //id of rendered sequencejs (the container will constructed by the widget with the given id)
* 'imageKey'=>'front_image', //model attribute to be used as image
* 'backgroundKey'=>'image', //model attribute to be used as background
* 'theme' => 'parallax', //available themes: default, parallax, modern
*
* 'css' => 'test.css', // url of css to overide default css relative from @web
*
* // example to overide default themes
* 'itemView'=>function ($model, $key, $widget) {
* $type = ['aeroplane','balloon','kite'];
* $html = '<li>
* <div class="info">
* <h2>'.$model->title.'</h2>
* <p>'.$model->description.'</p>
* </div>
* <img class="sky" src="'.$model->image.'" alt="Blue Sky" />
* <img class="'.$type[$key%3].'" src="'.$model->front_image.'" alt="Aeroplane" />
* </li>';
*
* return $html;
* },
*
*
* // example to overide default options more options on http://sequencejs.com
* 'options'=>[
* 'autoPlay'=> true,
* 'autoPlayDelay'=> 3000,
* 'cycle'=>true,
* 'nextButton'=> true,
* 'prevButton'=> true,
* 'preloader'=> true,
* 'navigationSkip'=> false
* ],
*
* // example to use widget without active data provider (the target selector should already rendered)
* 'targets' => [
* '.sequencejs' => [
* 'autoPlay'=> true,
* 'autoPlayDelay'=> 3000,
* 'cycle'=>true,
* 'nextButton'=> true,
* 'prevButton'=> true,
* 'preloader'=> true,
* 'navigationSkip'=> false
* ],
* ],
*
* ]);
* ```
*
* @author Amilna
* @see http://www.sequencejs.com/
*/
class SequenceJs extends \amilna\sequencejs\SequenceJs
{
}