public static function chennelingItem($row) { if (!is_array($row)) { $id = $row; $item = \app\models\Chenneling::find($id); if (is_null($item)) { return ''; } $row = $item->getFields(); } // Заголовок $html[] = Html::tag('div', Html::tag('h4', $row['header']), ['class' => 'header']); // Дата $html[] = Html::tag('p', self::dateString($row['date']), Html::css(['font-size' => '70%', 'color' => '#808080'])); // картинка с ссылкой $year = substr($row['date'], 0, 4); $month = substr($row['date'], 5, 2); $day = substr($row['date'], 8, 2); $html[] = Html::tag('p', Html::a(Html::img($row['img'], ['width' => '100%', 'class' => 'thumbnail']), "/chenneling/{$year}/{$month}/{$day}/{$row['id_string']}")); // Описание $html[] = Html::tag('p', $row['description']); return Html::tag('div', join('', $html), ['class' => 'col-sm-4 chennelingItem']); }