<?php

if (!empty($record->image)) {

    echo '
        <a
            data-control="popup"
            data-size="large"
            data-handler="onShowImage"
            data-request-data="image:\''.$record->image[0]["photo"].'\'"
            href="javascript:;">
            <img src="/storage/app/media'.$record->image[0]["photo"].'" height="42" alt="'.$record->title.'">
        </a>
    ';
}
