Skip to content

Commit

Permalink
Merge pull request #2 from drunomics/feature/LDP-97
Browse files Browse the repository at this point in the history
LDP-97: Method that returns variant url.
  • Loading branch information
fago authored Apr 5, 2019
2 parents 9fb54cb + 11efad8 commit bf01b99
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/RequestMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,25 @@ public static function getSiteVariables($site = NULL) {
return $vars;
}

/**
* Gets the variant host.
*
* @param string $variant
* Variant name.
*
* @return string|null
* Variant hostname or null if variant incorrect.
*/
public function getHostForSiteVariant($variant) {
if (!in_array($variant, $this->variants)) {
return NULL;
}
$site_variables = static::getSiteVariables();
$variant_host = $variant . $this->variantSeparator . $site_variables['SITE_MAIN_HOST'];

return $variant_host;
}

/**
* Gets the site variables as string.
*
Expand Down

0 comments on commit bf01b99

Please sign in to comment.