PHP Classes

File: views/frontend/block/gallery.php

Recommend this page to a friend!
  Classes of Gabriel Alejandro López López   Yii2 Website Module   views/frontend/block/gallery.php   Download  
File: views/frontend/block/gallery.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Yii2 Website Module
Add a content page management system to a site
Author: By
Last change:
Date: 2 months ago
Size: 560 bytes
 

Contents

Class file image Download
<?php
use yii\helpers\Html;
?>

<div class="container-fluid">
    <?= \dosamigos\gallery\Gallery::widget([
       
'items' => array_map(function($model){
            return [
               
'src' => Yii::$app->thumbnailer->get($model->image, 640, 480),
               
'url' => $model->image,
               
'options' => ['class' => 'col-md-3 p-0'],
               
'imageOptions' => ['class' => 'img-fluid', 'alt' => Html::encode($model->title)],
            ];
        },
$dataProvider->allModels),
       
'options' => ['class' => 'row'],
    ])
?>
</div>