I am trying to convert this from D7 to D8:
l(drupal_strtoupper($field),
sprintf('http://finance.google.com/finance?q=%s',
$exchange . ':' . $field),
array('attributes' =>
array('target' => '_blank',
'title' => (drupal_strlen($title)) ? $title : $field)
)
);
I am doing this and it produced error:
return Link::fromTextAndUrl(Unicode::strtoupper($field), Url::fromUri(sprintf('http://finance.google.com/finance?q=%s'),$exchange . ':' . $field))->toString();
InvalidArgumentException: The URI '' is invalid. You must use a valid URI scheme. in Drupal\Core\Url::fromUri() (line 281 of core/lib/Drupal/Core/Url.php)