PHP Classes

File: views/backend/page/_view-gallery.php

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

Contents

Class file image Download
<?php

use yii\helpers\Html;

$context = $this->context;
$module = $context->module->id;

$thumbnailer = Yii::$app->thumbnailer;

$image = $model->image
   
? $thumbnailer->get($model->image, 300, 300)
    :
$thumbnailer->get(Yii::getAlias('@web/images/default-image.png'), 300, 300);
?>

<div class="card">
    <?= Html::a(Html::img($image, ['class' => 'img-fluid'])) ?>
<div class="card-footer">
        <?= Html::a(Yii::t('website','Delete'), ["/$module/page/delete", 'id' => $model->id], [
           
'class' => 'btn btn-danger btn-block',
           
'data-method' => 'post',
           
'data-confirm' => Yii::t('website','Are you sure you want to delete this item?')
        ])
?>
</div>
</div>