public function SubdomainMethod::exitContext in Persistent URL 8
Overrides MethodInterface::exitContext
File
- src/
Plugin/ Purl/ Method/ SubdomainMethod.php, line 67
Class
- SubdomainMethod
- Plugin annotation @PurlMethod( id="subdomain", name="Subdomain" )
Namespace
Drupal\purl\Plugin\Purl\MethodCode
public function exitContext($modifier, $path, array &$options) {
$baseHost = $this
->getBaseHost();
if (!$this
->hostContainsModifier($modifier, $baseHost)) {
return null;
}
// Strip out modifier sub-domain.
$host = substr($baseHost, 0, strlen($modifier) + 1);
$options['absolute'] = true;
$options['host'] = $host;
return $path;
}