LinkManagerBase::getLinkDomain

protected LinkManagerBase::getLinkDomain()

Gets the link domain.

Return value

string The link domain.

File

core/modules/rest/src/LinkManager/LinkManagerBase.php, line 45

Class

LinkManagerBase
Defines an abstract base-class for REST link manager objects.

Namespace

Drupal\rest\LinkManager

Code

protected function getLinkDomain() {
  if (empty($this->linkDomain)) {
    if ($domain = $this->configFactory->get('rest.settings')->get('link_domain')) {
      $this->linkDomain = rtrim($domain, '/');
    }
    else {
      $request = $this->requestStack->getCurrentRequest();
      $this->linkDomain = $request->getSchemeAndHttpHost() . $request->getBasePath();
    }
  }
  return $this->linkDomain;
}
doc_Drupal
2016-10-29 09:23:24
Comments
Leave a Comment

Please login to continue.