getPortalUrl() public method

Returns the url of the current portal.
public getPortalUrl ( ) : string
return string
コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getContentRootPath($full = false)
 {
     if ($this->requestAnalyzer !== null) {
         if ($full) {
             return $this->requestAnalyzer->getPortalUrl();
         } else {
             return $this->requestAnalyzer->getResourceLocatorPrefix();
         }
     } else {
         return '/';
     }
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function resolve(RequestAnalyzerInterface $requestAnalyzer)
 {
     // determine default locale (if one exists)
     $defaultLocalization = $requestAnalyzer->getPortal()->getDefaultLocalization();
     $defaultLocale = $defaultLocalization ? $defaultLocalization->getLocalization() : null;
     return ['request' => ['webspaceKey' => $requestAnalyzer->getWebspace()->getKey(), 'defaultLocale' => $defaultLocale, 'locale' => $requestAnalyzer->getCurrentLocalization()->getLocalization(), 'portalUrl' => $requestAnalyzer->getPortalUrl(), 'resourceLocatorPrefix' => $requestAnalyzer->getResourceLocatorPrefix(), 'resourceLocator' => $requestAnalyzer->getResourceLocator(), 'get' => $requestAnalyzer->getGetParameters(), 'post' => $requestAnalyzer->getPostParameters(), 'analyticsKey' => $requestAnalyzer->getAnalyticsKey()]];
 }
コード例 #3
0
ファイル: ContentRouteProvider.php プロジェクト: sulu/sulu
 /**
  * @return Route
  */
 protected function getRedirectWebSpaceRoute()
 {
     $localization = $this->defaultLocaleProvider->getDefaultLocale();
     $redirect = $this->requestAnalyzer->getRedirect();
     $redirect = $this->urlReplacer->replaceCountry($redirect, $localization->getCountry());
     $redirect = $this->urlReplacer->replaceLanguage($redirect, $localization->getLanguage());
     $redirect = $this->urlReplacer->replaceLocalization($redirect, $localization->getLocale(Localization::DASH));
     // redirect by information from webspace config
     // has to be done for all routes, because double slashes introduce problems otherwise
     return new Route('/{wildcard}', ['_controller' => 'SuluWebsiteBundle:Redirect:redirectWebspace', 'url' => $this->requestAnalyzer->getPortalUrl(), 'redirect' => $redirect], ['wildcard' => '.*']);
 }
コード例 #4
0
 /**
  * @param Request $request
  *
  * @return Route
  */
 protected function getRedirectWebSpaceRoute(Request $request)
 {
     // redirect by information from webspace config
     return new Route($request->getPathInfo(), ['_controller' => 'SuluWebsiteBundle:Default:redirectWebspace', 'url' => $this->requestAnalyzer->getPortalUrl(), 'redirect' => $this->requestAnalyzer->getRedirect()]);
 }