eseperio/yii2-splide

Yii2 wrapper for Spidejs slider

Installs: 23

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

1.1.0 2021-04-27 08:50 UTC

This package is auto-updated.

Last update: 2024-09-27 16:29:59 UTC


README

A yii2 wrapper for SplideJs slider.

License

MIT license. See license

Content

  • Assets
    • Asset bundle with main styles (SplideCoreAsset)
    • Asset bundle with main styles and default theme (SplideAsset)
  • Widgets
    • Splide: Widget to render a splide slider
    • SplideThumbnailCarousel: Renders two sliders synced, one for main slider and other for thumbnails.

Installation:

Using composer:

composer require eseperio/yii2-splide

Usage

Widgets

There are two widgets. The former, a simple Splide slide, while the latter is a combination of two Splide slider for creating a carousel with thumbnail navigation (See thumbnail slider)

Video and grid not yet supported in current version of the wrapper.
echo Splide::widget([
    'items' => [
                   [
                       'url' => 'http://someurl.com/image.jpg'
                   ],
                   [
                       'url' => ['some/yii2urlformat', 'param1' => 'example']
                   ],
                   [
                       'type'=> Splide::TYPE_HTML,
                       'html'=> 'htmlcodegoeshere',
                   ]
               ],
   
]);

Thumbnail slider

echo \eseperio\splide\widgets\SplideThumbnailCarousel::widget([
                    'items' => $items
                ]);

Changelog

Options

All options of Splide can be defined through widget properties

Properties of widget only

Properties from Splidejs