App\Libraries\Utils::formatWebsite PHP Метод

formatWebsite() публичный статический Метод

public static formatWebsite ( $website )
    public static function formatWebsite($website)
    {
        if (!$website) {
            return '';
        }
        $link = $website;
        $title = $website;
        $prefix = 'http://';
        if (strlen($link) > 7 && substr($link, 0, 7) === $prefix) {
            $title = substr($title, 7);
        } else {
            $link = $prefix . $link;
        }
        return link_to($link, $title, ['target' => '_blank']);
    }