Sulu\Component\CustomUrl\Document\CustomUrlBehavior::getTargetLocale PHP Method

getTargetLocale() public method

Returns locale for target.
public getTargetLocale ( ) : string
return string
    public function getTargetLocale();

Usage Example

Ejemplo 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\CustomUrl\Document\CustomUrlBehavior::getTargetLocale