public function InstallablePluginBase::getUrl in Markdown 8.2
Retrieves the URL of the plugin, if set.
Parameters
array $options: Optional. An array of \Drupal\Core\Url options.
Return value
\Drupal\Core\Url|void A Url object of the plugin's URL or NULL if no URL was provided.
Overrides InstallablePluginInterface::getUrl
See also
\Drupal\Core\Url::fromUri
\Drupal\Core\Url::fromUserInput
File
- src/
Plugin/ Markdown/ InstallablePluginBase.php, line 302
Class
- InstallablePluginBase
- Base class for installable plugins.
Namespace
Drupal\markdown\Plugin\MarkdownCode
public function getUrl(array $options = []) {
if ($url = $this->pluginDefinition->url) {
if (UrlHelper::isExternal($url)) {
$options['attributes']['target'] = '_blank';
return Url::fromUri($url)
->setOptions($options);
}
return Url::fromUserInput($url)
->setOptions($options);
}
}