PHP Classes

File: views/frontend/block/carousel.php

Recommend this page to a friend!
  Classes of Gabriel Alejandro López López   Yii2 Website Module   views/frontend/block/carousel.php   Download  
File: views/frontend/block/carousel.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: 1 month ago
Size: 355 bytes
 

Contents

Class file image Download
<?php

use yii\helpers\Html;
use
yii\bootstrap4\Carousel;
?>

<?= Carousel::widget([
   
'items' => array_map(function($model){
        return [
           
'content' => Html::img($model->image, ['alt' => Html::encode($model->title)]),
           
'caption' => Html::tag('h2', Html::encode($model->title))
        ];
    },
$dataProvider->allModels)
])
?>