<?php
use \common\modules\content\models\CoContent;
use yii\helpers\Html;
use yii\helpers\Url;

$models = CoContent::find()
            ->where([
                'category_id' => 4,
                'active' => true
            ])
            ->orderBy('id DESC')
            ->all();
?>
<?php if($models) : ?>

    <div class="row">
        <?php foreach ($models as $model) : ?>
            <div class="col-md-6 col-xs-6 col-sm-12">
                <div class="keys_block_small">
                    <img src="<?=$model->preview?>" height="338" width="455">
                    <a href="<?=Url::to(['/'.$model->url])?>" class="keys_small_title" <?if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?}?>><?=$model->lang->title?></a>
                    <div class="keys_small_foot">
                        <?=Html::a('<span>Подробнее</span>', ['/'.$model->url], ['class' => 'keys_small_btn_more'])?>
                        <!-- <a href="#" class="keys_small_tags"># Big data</a> -->
                    </div>
                </div>
            </div>
        <?php endforeach; ?>
        <!-- <div class="col-md-6 col-xs-6 col-sm-12">
            <div class="keys_block_small">
                <img src="/images/keys_small2.jpg" height="338" width="455" alt="">
                <div class="keys_small_title">Автоматизация освещения на АЗС</div>
                <div class="keys_small_foot">
                    <a href="#" class="keys_small_btn_more"><span>Подробнее</span></a>
                    <a href="#" class="keys_small_tags"># Big data</a>
                </div>
            </div>
        </div> -->
    </div>
    <!-- <div class="row">
        <div class="col-md-12 col-xs-12 col-sm-12">
            <div class="keys_block_big">                        
                <picture>
                    <source srcset="images/keys_big338.jpg" media="(max-width: 768px)">
                    <img src="/images/keys_big1.jpg" height="338" width="940" alt="">
                </picture>
                <div class="keys_small_title">Он-лайн сервис по подбору аналогов оборудования</div>
                <div class="keys_small_foot">
                    <a href="#" class="keys_small_btn_more"><span>Подробнее</span></a>
                    <a href="#" class="keys_small_tags"># Big data</a>
                </div>
            </div>
        </div>
    </div> -->

<?php endif; ?>