Gdn_Format::image PHP Method

image() public static method

Format an encoded string of image properties as HTML.
public static image ( string $Body ) : string
$Body string a encoded array of image properties (Image, Thumbnail, Caption)
return string HTML
    public static function image($Body)
    {
        if (is_string($Body)) {
            $Image = dbdecode($Body);
            if (!$Image) {
                return Gdn_Format::html($Body);
            }
        }
        $Url = val('Image', $Image);
        $Caption = Gdn_Format::plainText(val('Caption', $Image));
        return '<div class="ImageWrap">' . '<div class="Image">' . img($Url, array('alt' => $Caption, 'title' => $Caption)) . '</div>' . '<div class="Caption">' . $Caption . '</div>' . '</div>';
    }