30 lines
1.4 KiB
PHP
30 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Created by HanumanIT Co.,Ltd.
|
|
* User: kongoon
|
|
* Date: 2020-02-10
|
|
* Time: 00:05
|
|
*/
|
|
|
|
use yii\helpers\Html;
|
|
use yii\helpers\StringHelper;
|
|
|
|
?>
|
|
<div class="col-md-4 my-2 ">
|
|
<div class="card shadow img-post">
|
|
<?= Html::img(Yii::$app->abt->getFirstImage($model->description), ['class' => 'card-img-top']) ?>
|
|
|
|
<div class="card-body">
|
|
<?= Html::a('<h5 class="card-title">' . StringHelper::truncate(strip_tags($model->name), 50, '...', 'utf-8', false) . '</h5>', ['/post/view', 'id' => $model->id, 'slug' => Yii::$app->abt->simpleSlug($model->name)], ['title' => $model->name]) ?>
|
|
<div class="post-summary">
|
|
<span class="fa fa-calendar"></span> <?= Yii::$app->formatter->asDatetime($model->publish_at) ?>
|
|
<span class="fa fa-folder-open"></span> <?= Html::a($model->cmsCategory->name, ['/post/index', 'id' => $model->cms_category_id, 'slug' => Yii::$app->abt->simpleSlug($model->cmsCategory->name)], ['title' => $model->cmsCategory->name]) ?>
|
|
<span class="fa fa-user"></span> <?= Html::a($model->createdBy->name, ['/site/author', 'id' => $model->created_by]) ?>
|
|
<span class="fa fa-eye"></span> <?= number_format($model->hit) ?>
|
|
</div>
|
|
<?= StringHelper::truncate(strip_tags($model->description), 50, '...', 'utf-8', false) ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|