HreflangStruct example

/** * @param array{languageId: string, id: string, url: string, locale: string, onlyLocale: bool} $domain * @param array{seoPathInfo: string, languageId: string}|null $seoUrl */
    private function addHreflangForDomain(
        array $domain,
        ?array $seoUrl,
        ?string $defaultDomainId,
        HreflangCollection $collection
    ): void {
        $hrefLang = new HreflangStruct();

        $hrefLang->setUrl($domain['url']);
        if ($seoUrl) {
            $hrefLang->setUrl($domain['url'] . '/' . $seoUrl['seoPathInfo']);
        }
        $locale = $domain['locale'];

        if ($domain['onlyLocale']) {
            $locale = mb_substr($locale, 0, 2);
        }

        
Home | Imprint | This part of the site doesn't use cookies.