item.php 1.24 KB
<?php

use yii\helpers\Html;
use frontend\components\ImageResizer;

/**
 *
 * @author FilamentV <vortex.filament@gmail.com>
 * @copyright (c), Thread
 *
 * @var $model \frontend\modules\news\models\Article
 */

//$image = $model->getImageLink();
$image = ImageResizer::getThumb($model->getImagePath(), 350, 240);
$link = $model->getUrl();
if ($image === null) {
    $image = '/images/blog-thumb-1.jpg';
}
?>
<div class="media margin-clear">
    <div class="row">
        <div class="col-sm-12">
            <div class="overlay-container">
                <?= Html::img($image, [
                    'alt' => $model['lang']['title'],
                    'class' => 'media-object',
                    'style' => 'width: 100%;'
                ]) ?>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="media-body" style="padding-top: 10px;">
                <div class="post-info" style="margin-bottom: 8px;">
            <span class="post-date">
                <?= $model->getPublishedTime() ?>
            </span>
                </div>
                <div class="media-heading">
                    <?= Html::a($model['lang']['title'], $link) ?>
                </div>
            </div>
        </div>
    </div>
    <hr>
</div>