PHP code example of dev7ch / luya-ext-slick

1. Go to this page and download the library: Download dev7ch/luya-ext-slick library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dev7ch / luya-ext-slick example snippets



<?= SlickWidget::widget([
    'images' => $images,
    'slickConfigFile' => 'path/to/yourConfig.php'  // or a .json file
]);
html

use dev7ch\slick\SlickWidget;

$images = $this->extraValue('images'); // Array of images width additional fields

html
<div class="slider slick-slider" itemscope itemtype="http://schema.org/ImageGallery">
     foreach ($widget->images as $image):
        $title = $image['title'];
        $link = $image['link'];
        $imageFallback = $image['image']->source;
        $respImages = $image['responsive_images'];
        $alt = $image['alt'];
    
html
// ... wrapped by foreach loop with vars declaration  

<div class="slider-item">
   <figure itemprop="associatedMedia" class="slider-image-container" itemscope itemtype="http://schema.org/ImageObject">
        if (!empty($link)) {return '<a href="'.$link->link.'" itemprop="contentUrl">';}