/** * Generate a Link tag. * * @param string $sLink The link * @param boolean $bNoFollow Set "true" for the rel="nofollow" attribute otherwise "false". Default value is "true" * @return void The HTML link tag. */ public function urlTag($sLink, $bNoFollow = true) { $sNoFollowTag = $bNoFollow === true ? ' rel="nofollow"' : ''; $sLinkName = \PH7\Framework\Parse\Url::name($sLink); echo '<a href="', $sLink, '" title="', $sLinkName, '"', $sNoFollowTag, '>', $sLinkName, '</a>'; }
/** * Generate a Link tag. * * @param string $sLink The link. * @param boolean $bNoFollow Set TRUE to set the link "nofollow", FALSE otherwise. Default TRUE * @return void The HTML link tag. */ public function urlTag($sLink, $bNoFollow = true) { $sLinkName = \PH7\Framework\Parse\Url::name($sLink); $aDefAttrs = ['href' => $sLink, 'title' => $sLinkName]; if ($bNoFollow) { $aDefAttrs += ['rel' => 'nofollow']; } // Add "nofollow" attribute if "$bNoFollow" is TURE $this->htmlTag('a', $aDefAttrs, true, $sLinkName); }