Sulu\Component\Webspace\Manager\WebspaceManagerInterface::findUrlByResourceLocator PHP Method

findUrlByResourceLocator() public method

Returns the main url for resourcelocator.
public findUrlByResourceLocator ( string $resourceLocator, string $environment, string $languageCode, null | string $webspaceKey = null, null | string $domain = null, string $scheme = 'http' ) : string
$resourceLocator string
$environment string
$languageCode string
$webspaceKey null | string
$domain null | string
$scheme string
return string
    public function findUrlByResourceLocator($resourceLocator, $environment, $languageCode, $webspaceKey = null, $domain = null, $scheme = 'http');

Usage Example

Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 protected function doEnhance(CustomUrlBehavior $customUrl, Webspace $webspace, array $defaults, Request $request)
 {
     $seo = ['noFollow' => $customUrl->isNoFollow(), 'noIndex' => $customUrl->isNoIndex()];
     if ($customUrl->isCanonical()) {
         $resourceSegment = $customUrl->getTargetDocument()->getResourceSegment();
         $seo['canonicalUrl'] = $this->webspaceManager->findUrlByResourceLocator($resourceSegment, $defaults['_environment'], $customUrl->getTargetLocale(), $webspace->getKey());
     }
     return ['_seo' => $seo];
 }
All Usage Examples Of Sulu\Component\Webspace\Manager\WebspaceManagerInterface::findUrlByResourceLocator