public static function image($src, $alt = '', $options = [])
    {
        $image_tag_tpl = '<img src="%s" alt="%s"%s />';
        $cdnHost = Lb::app()->getCdnHost();
        if ($cdnHost) {
            if (!ValidationHelper::isUrl($src)) {
                $src = $cdnHost . $src;
            } else {
                $src = preg_replace('/^(http|https):\/\/.+?\//i', $cdnHost . '/', $src);
            }
        }
        return sprintf($image_tag_tpl, $src, $alt, self::assembleTagOptions($options));
    }
public static function image($src, $alt = '', $options = [])
    {
        $image_tag_tpl = '<img src="%s" alt="%s"%s />';
        $cdnHost = Lb::app()->getCdnHost();
        if ($cdnHost) {
            if (!ValidationHelper::isUrl($src)) {
                $src = $cdnHost . $src;
            } else {
                $src = preg_replace('/^(http|https):\/\/.+?\//i', $cdnHost . '/', $src);
            }
        }
        return sprintf($image_tag_tpl, $src, $alt, self::assembleTagOptions($options));
    }
public static function image ( $ src , $ alt = '' , $ options = [ ] ) { $ image_tag_tpl = '<img src="%s" alt="%s"%s />' ; $ cdnHost = Lb :: app ( ) -> getCdnHost ( ) ; if ( $ cdnHost ) { if ( ! ValidationHelper :: isUrl ( $ src ) ) { $ src = $ cdnHost . $ src ; } else { $ src = preg_replace ( '/^(http|https):\/\/.+?\//i' , $ cdnHost . '/' , $ src ) ; } } return sprintf ( $ image_tag_tpl , $ src , $ alt , self :: assembleTagOptions ( $ options ) ) ; }
Generate image tag

@param $src
@param string $alt
@param array $options
@return string
Generate image tag