-
-
Notifications
You must be signed in to change notification settings - Fork 320
Expand file tree
/
Copy pathSlider.php
More file actions
27 lines (21 loc) · 627 Bytes
/
Slider.php
File metadata and controls
27 lines (21 loc) · 627 Bytes
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
<?php
namespace Frontend\Modules\MediaLibrary\Widgets;
use Frontend\Modules\MediaLibrary\Widgets\Base\FrontendMediaWidget;
/**
* This will show a MediaGroup (Custom Module) or a MediaGallery (Media Module) in a slider using BxSlider.
*/
class Slider extends FrontendMediaWidget
{
public function execute(): void
{
$this->loadData();
// We need to have a MediaGroup to show this widget
if (!$this->mediaGroup) {
return;
}
$this->addJS('/js/vendors/slick.min.js', true);
parent::execute();
$this->loadTemplate();
$this->parse();
}
}