core/tag/tags/LinkTag.php
public function parse($value, $sub)
    {
        if (substr($value, 0, 2) == '//') {
            $value = StringHelper::replaceFirst('//', Url::base(true) . '/', $value);
            $external = false;
        } else {
            $external = true;
        }
        
        $value = Url::ensureHttp($value);
        $label = empty($sub) ? $value : $sub;
        
        return Html::a($label, $value, ['class' => $external ? 'link-external' : 'link-internal', 'target' => $external ? '_blank' : null]);
    }
public function parse($value, $sub)
    {
        if (substr($value, 0, 2) == '//') {
            $value = StringHelper::replaceFirst('//', Url::base(true) . '/', $value);
            $external = false;
        } else {
            $external = true;
        }
        
        $value = Url::ensureHttp($value);
        $label = empty($sub) ? $value : $sub;
        
        return Html::a($label, $value, ['class' => $external ? 'link-external' : 'link-internal', 'target' => $external ? '_blank' : null]);
    }
public function parse ( $ value , $ sub ) { if ( substr ( $ value , 0 , 2 ) == '//' ) { $ value = StringHelper :: replaceFirst ( '//' , Url :: base ( true ) . '/' , $ value ) ; $ external = false ; } else { $ external = true ; } $ value = Url :: ensureHttp ( $ value ) ; $ label = empty ( $ sub ) ? $ value : $ sub ; return Html :: a ( $ label , $ value , [ 'class' => $ external ? 'link-external' : 'link-internal' , 'target' => $ external ? '_blank' : null ] ) ; }
Generate the Link Tag.

@param string $value The Brackets value `[]`.
@param string $sub The optional Parentheses value `()`
@see \luya\tag\TagInterface::parse()
@return string The parser tag.
Generate the Link Tag .