Example #1
0
"/>
            <img class="add-box-second-image" src="<?php 
echo $post->photo;
?>
"/>
        </a>
    </div>
    <div class="list-feat-ad-content">
        <div class="list-feat-ad-title">
            <a href="/"><?php 
echo strlen($post->title) > 50 ? substr($post->title, 0, 47) . '...' : $post->title;
?>
</a>
            <div class="add-price"><span><?php 
echo $post->price;
?>
</span></div>
        </div>
        <div class="list-feat-ad-excerpt">
            <p>
                <?php 
echo \common\helpers\TextHelper::limit_text($post->content, 20);
?>
            </p>
        </div>
        <div class="read-more"><a href="/"><?php 
echo \Yii::t('site', 'Details');
?>
</a></div>
    </div>
</div>
Example #2
0
use yii\bootstrap\Html;
use yii\helpers\Url;
$images = \frontend\models\PostImage::findAll(['post' => $item->id]);
if (sizeof($item->photos) > 1) {
    $secondImage = $item->photos[1]->link;
}
?>

<a class="ad-image" href="<?php 
echo \yii\helpers\Url::toRoute(['post/' . $item->id]);
?>
">
    <img class="add-box-main-image" src="<?php 
echo $item->photo;
?>
"/>
    <img class="add-box-second-image" src="<?php 
echo isset($secondImage) ? $secondImage : $item->photo;
?>
"/>
</a>
<div class="ad-box-content">
    <?php 
echo Html::a(TextHelper::limit_text($item->title, 37), Url::toRoute(['post/' . $item->id]));
?>
    <div class="add-price">
        <?php 
echo Html::tag('span', $item->price);
?>
    </div>
</div>