public function SubdomainMethod::contains in Persistent URL 8
Overrides MethodInterface::contains
File
- src/
Plugin/ Purl/ Method/ SubdomainMethod.php, line 20
Class
- SubdomainMethod
- Plugin annotation @PurlMethod( id="subdomain", name="Subdomain" )
Namespace
Drupal\purl\Plugin\Purl\MethodCode
public function contains(Request $request, $modifier) {
$baseHost = $this
->getBaseHost();
if (!$baseHost) {
return false;
}
$host = $request
->getHost();
if ($host === $this
->getBaseHost()) {
return false;
}
return $this
->hostContainsModifier($modifier, $request
->getHost());
}