You are here

public function PlatformBase::getUrl in Social Media Links Block and Field 8.2

Get the full url for the platform.

Return the full url, including urlPrefix, user value and urlSuffix This method is useful to change the url to match platform specific requirements. E.g.: "mailto:VALUE" for email platform or "user-path:/" for internal urls.

Return value

\Drupal\Core\Url Returns the full Url object for the platform.

Overrides PlatformInterface::getUrl

2 methods override PlatformBase::getUrl()
Contact::getUrl in src/Plugin/SocialMediaLinks/Platform/Contact.php
Get the full url for the platform.
Email::getUrl in src/Plugin/SocialMediaLinks/Platform/Email.php
Get the full url for the platform.

File

src/PlatformBase.php, line 78

Class

PlatformBase
Base class for platform.

Namespace

Drupal\social_media_links

Code

public function getUrl() {
  return Url::fromUri($this
    ->getUrlPrefix() . $this
    ->getValue() . $this
    ->getUrlSuffix());
}