Class

eZ\Publish\Core\MVC\Symfony\Templating\GlobalHelper

class GlobalHelper

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.

Methods

__construct(ConfigResolverInterface $configResolver, LocationService $locationService, RouterInterface $router, TranslationHelper $translationHelper)

SiteAccess|null getSiteaccess()

Returns the current siteaccess.

array|null getViewParameters()

Returns the view parameters as a hash.

string getViewParametersString()

Returns the view parameters as a string.

string getRequestedUriString()

Returns the requested URI string (aka semanticPathInfo).

null|string getSystemUriString()

Returns the "system" URI string.

Location getRootLocation()

Returns the root location.

null|string getTranslationSiteAccess(string $language)

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

array getAvailableLanguages()

Returns the list of available languages.

ConfigResolverInterface getConfigResolver()

Returns the config resolver.

Details

at line 46
public __construct(ConfigResolverInterface $configResolver, LocationService $locationService, RouterInterface $router, TranslationHelper $translationHelper)

Parameters

ConfigResolverInterface $configResolver
LocationService $locationService
RouterInterface $router
TranslationHelper $translationHelper

at line 63
public SiteAccess|null getSiteaccess()

Returns the current siteaccess.

Return Value

SiteAccess|null

at line 76
public array|null getViewParameters()

Returns the view parameters as a hash.

Return Value

array|null

at line 90
public string getViewParametersString()

Returns the view parameters as a string.

e.g. /(foo)/bar.

Return Value

string

at line 103
public string getRequestedUriString()

Returns the requested URI string (aka semanticPathInfo).

Return Value

string

at line 120
public null|string 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.

Return Value

null|string

at line 144
public Location getRootLocation()

Returns the root location.

Return Value

Location

at line 158
public null|string getTranslationSiteAccess(string $language)

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

Parameters

string $language

Return Value

null|string

at line 168
public array getAvailableLanguages()

Returns the list of available languages.

Return Value

array

at line 178
public ConfigResolverInterface getConfigResolver()

Returns the config resolver.