private function getTemplatePreview(Uploads $model) { $filePath = Employee::getUploadUrl() . '/' . $model->ref . '/thumbnail/' . $model->real_filename; $isImage = $this->isImage($filePath); if ($isImage) { $file = Html::img($filePath, ['class' => 'file-preview-image', 'alt' => $model->file_name, 'title' => $model->file_name]); } else { $file = "<div class='file-preview-other'> " . "<h2><i class='glyphicon glyphicon-file'></i></h2>" . "</div>"; } return $file; }