PHP Classes

File: views/frontend/page/_list-view.php

Recommend this page to a friend!
  Classes of Gabriel Alejandro López López   Yii2 Website Module   views/frontend/page/_list-view.php   Download  
File: views/frontend/page/_list-view.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: 867 bytes
 

Contents

Class file image Download
<?php

use yii\helpers\Html;

$textColumnClass = isset($model->image) ? 'col-md-8' : 'col-md-4';

?>

<div class="card mb-4">
    <div class="row">
        <?php if ($model->image): ?>
<div class="col-md-4">
                <?= Html::a(Html::img(Yii::$app->thumbnailer->get($model->image, 640, 480), ['class' => 'img-fluid']), $model->url) ?>
</div>
        <?php endif; ?>
<div class="<?= $textColumnClass ?>">
            <div class="card-body">
                <h2 class="card-title"><?= Html::a(Html::encode($model->title), $model->url) ?></h2>
                <p class="text-muted m-0">
                    <small><?= Yii::$app->formatter->asDate($model->created_at) ?></small>
                </p>
                <p class="card-text"><?= Html::encode($model->abstract) ?></p>
            </div>
        </div>
    </div>
</div>