Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper Class Reference

Templating helper object globally accessible, through the "ezpublish" variable (in Twig). More...

## Public Member Functions
| __construct (ConfigResolverInterface $configResolver, LocationService $locationService, RouterInterface $router, TranslationHelper $translationHelper)
| getSiteaccess ()
| Returns the current siteaccess. More...
| getViewParameters ()
| Returns the view parameters as a hash. More...
| getViewParametersString ()
| Returns the view parameters as a string. More...
| getRequestedUriString ()
| Returns the requested URI string (aka semanticPathInfo). More...
| getSystemUriString ()
| Returns the "system" URI string. More...
| getRootLocation ()
| Returns the root location. More...
| getTranslationSiteAccess ($language)
| Returns the translation SiteAccess for $language, or null if it cannot be found. More...
| getAvailableLanguages ()
| Returns the list of available languages. More...
| getConfigResolver ()
| Returns the config resolver. More...

## Protected Attributes
| $configResolver
| $locationService
| $router
| $translationHelper

## Detailed Description

Templating helper object globally accessible, through the "ezpublish" variable (in Twig).

Container is injected to be sure to lazy load underlying services and to avoid scope conflict.

Definition at line 20 of file GlobalHelper.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::__construct | ( | ConfigResolverInterface | $configResolver,
|  | LocationService | $locationService,
|  | RouterInterface | $router,
|  | TranslationHelper | $translationHelper
| ) |  |

Definition at line 36 of file GlobalHelper.php.

References eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\$configResolver, eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\$locationService, eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\$router, and eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\$translationHelper.

## Member Function Documentation

## ◆ getAvailableLanguages()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getAvailableLanguages | ( |  | ) |

Returns the list of available languages.

Returns
  array

Definition at line 158 of file GlobalHelper.php.

## ◆ getConfigResolver()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getConfigResolver | ( |  | ) |

Returns the config resolver.

Returns
  \eZ\Publish\Core\MVC\ConfigResolverInterface

Definition at line 168 of file GlobalHelper.php.

References eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\$configResolver.

## ◆ getRequestedUriString()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getRequestedUriString | ( |  | ) |

Returns the requested URI string (aka semanticPathInfo).

Returns
  string

Definition at line 93 of file GlobalHelper.php.

References eZ\Publish\Core\MVC\Symfony\getCurrentRequest().

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\getSystemUriString().

## ◆ getRootLocation()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getRootLocation | ( |  | ) |

Returns the root location.

Returns
  \eZ\Publish\API\Repository\Values\Content\Location

Definition at line 134 of file GlobalHelper.php.

## ◆ getSiteaccess()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getSiteaccess | ( |  | ) |

Returns the current siteaccess.

Returns
  \eZ\Publish\Core\MVC\Symfony\SiteAccess|null

Definition at line 53 of file GlobalHelper.php.

References eZ\Publish\Core\MVC\Symfony\getCurrentRequest().

## ◆ getSystemUriString()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getSystemUriString | ( |  | ) |

Returns the "system" URI string.

System URI is the URI for internal content controller. E.g. /content/location/123/full.

If current route is not an URLAlias, then the current Pathinfo is returned.

Returns
  string|null

Definition at line 110 of file GlobalHelper.php.

References eZ\Publish\Core\MVC\Symfony\getCurrentRequest(), eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\getRequestedUriString(), and eZ\Publish\Core\MVC\Symfony\Routing\UrlAliasRouter\URL_ALIAS_ROUTE_NAME.

## ◆ getTranslationSiteAccess()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getTranslationSiteAccess | ( |  | $language | ) |

Returns the translation SiteAccess for $language, or null if it cannot be found.

Parameters

  string | $language |

Returns
  string|null

Definition at line 148 of file GlobalHelper.php.

## ◆ getViewParameters()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getViewParameters | ( |  | ) |

Returns the view parameters as a hash.

Returns
  array|null

Definition at line 66 of file GlobalHelper.php.

References eZ\Publish\Core\MVC\Symfony\getCurrentRequest().

## ◆ getViewParametersString()

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::getViewParametersString | ( |  | ) |

Returns the view parameters as a string.

e.g. /(foo)/bar.

Returns
  string

Definition at line 80 of file GlobalHelper.php.

References eZ\Publish\Core\MVC\Symfony\getCurrentRequest().

## Member Data Documentation

## ◆ $configResolver

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::$configResolver
| protected

Definition at line 25 of file GlobalHelper.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\__construct(), and eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\getConfigResolver().

## ◆ $locationService

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::$locationService
| protected

Definition at line 28 of file GlobalHelper.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\__construct().

## ◆ $router

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::$router
| protected

Definition at line 31 of file GlobalHelper.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\__construct().

## ◆ $translationHelper

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper::$translationHelper
| protected

Definition at line 34 of file GlobalHelper.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper\__construct().

The documentation for this class was generated from the following file:

- GlobalHelper.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.