File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ Add this line to your main layout so the widget gets loaded automatically into e
29
29
<?= \bluezed\scrollTop\ScrollTop::widget() ?>
30
30
```
31
31
32
+ To customize the class of the i and a-tags generated by the widget use the following syntax:
33
+ ``` php
34
+ <?= \bluezed\scrollTop\ScrollTop::widget([
35
+ 'i_class' => 'glyphicon glyphicon-menu-up bluezed-scroll-top-circle my_custom_class',
36
+ 'a_class' => 'bluezed-scroll-top my_other_custom_class') ?>
37
+ ```
38
+
39
+
32
40
By default your main layout should be located here:
33
41
```
34
42
<Project-Folder>/views/layouts/main.php
Original file line number Diff line number Diff line change 18
18
*/
19
19
class ScrollTop extends Widget
20
20
{
21
+ public $ i_class ;
22
+ public $ a_class ;
23
+
21
24
/**
22
25
* @inheritdoc
23
26
*/
24
27
public function init ()
25
28
{
29
+ if ($ this ->i_class === null ){
30
+ $ this ->i_class = 'glyphicon glyphicon-menu-up bluezed-scroll-top-circle ' ;
31
+ }
32
+ if ($ this ->a_class === null ){
33
+ $ this ->a_class = 'bluezed-scroll-top ' ;
34
+ }
35
+
26
36
$ view = $ this ->getView ();
27
37
ScrollTopAsset::register ($ view );
28
38
}
@@ -35,10 +45,10 @@ public function run()
35
45
Html::tag (
36
46
'i ' ,
37
47
'' ,
38
- ['class ' =>' glyphicon glyphicon-menu-up bluezed-scroll-top-circle ' ]
48
+ ['class ' => $ this -> i_class ]
39
49
),
40
50
'# ' ,
41
- ['id ' =>'btn-top-scroller ' , 'class ' =>' bluezed-scroll-top ' ]
51
+ ['id ' =>'btn-top-scroller ' , 'class ' => $ this -> a_class ]
42
52
);
43
53
}
44
- }
54
+ }
You can’t perform that action at this time.
0 commit comments