Class

eZ\Publish\Core\MVC\Symfony\Routing\Generator\UrlAliasGenerator

class UrlAliasGenerator extends Generator

URL generator for UrlAlias based links.

Constants

INTERNAL_LOCATION_ROUTE

INTERNAL_CONTENT_VIEW_ROUTE

Methods

setRequestContext(RequestContext $requestContext)

from Generator
setSiteAccessRouter(SiteAccessRouterInterface $siteAccessRouter)

from Generator
setSiteAccess(SiteAccess $siteAccess = null)

from Generator
setLogger(LoggerInterface $logger = null)

from Generator
string generate(mixed $urlResource, array $parameters, int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)

Triggers URL generation for $urlResource and $parameters.

from Generator
string doGenerate(Location $location, array $parameters)

Generates the URL from $urlResource and $parameters.

__construct(Repository $repository, RouterInterface $defaultRouter, ConfigResolverInterface $configResolver, array $unsafeCharMap = array())

setRootLocationId(int $rootLocationId)

Injects current root locationId that will be used for link generation.

setExcludedUriPrefixes(array $excludedUriPrefixes)

string getPathPrefixByRootLocationId(int $rootLocationId, array $languages = null, string $siteaccess = null)

Returns path corresponding to $rootLocationId.

bool isUriPrefixExcluded(string $uri)

Checks if passed URI has an excluded prefix, when a root location is defined.

Location loadLocation(int $locationId)

Loads a location by its locationId, regardless to user limitations since the router is invoked BEFORE security (no user authenticated yet).

Details

in Generator at line 46
public setRequestContext(RequestContext $requestContext)

Parameters

RequestContext $requestContext

in Generator at line 54
public setSiteAccessRouter(SiteAccessRouterInterface $siteAccessRouter)

Parameters

SiteAccessRouterInterface $siteAccessRouter

in Generator at line 62
public setSiteAccess(SiteAccess $siteAccess = null)

Parameters

SiteAccess $siteAccess

in Generator at line 70
public setLogger(LoggerInterface $logger = null)

Parameters

LoggerInterface $logger

in Generator at line 85
public string generate(mixed $urlResource, array $parameters, int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)

Triggers URL generation for $urlResource and $parameters.

Parameters

mixed $urlResource Type can be anything, depending on the context. It's up to the router to pass the appropriate value to the implementor.
array $parameters Arbitrary hash of parameters to generate a link. SiteAccess name can be provided as 'siteaccess' to generate a link to it (cross siteaccess link).
int $referenceType The type of reference to be generated (one of the constants)

Return Value

string

at line 83
public string doGenerate(Location $location, array $parameters)

Generates the URL from $urlResource and $parameters.

Entries in $parameters will be added in the query string.

Parameters

Location $location
array $parameters

Return Value

string

at line 66
public __construct(Repository $repository, RouterInterface $defaultRouter, ConfigResolverInterface $configResolver, array $unsafeCharMap = array())

Parameters

Repository $repository
RouterInterface $defaultRouter
ConfigResolverInterface $configResolver
array $unsafeCharMap

at line 143
public setRootLocationId(int $rootLocationId)

Injects current root locationId that will be used for link generation.

Parameters

int $rootLocationId

at line 151
public setExcludedUriPrefixes(array $excludedUriPrefixes)

Parameters

array $excludedUriPrefixes

at line 165
public string getPathPrefixByRootLocationId(int $rootLocationId, array $languages = null, string $siteaccess = null)

Returns path corresponding to $rootLocationId.

Parameters

int $rootLocationId
array $languages
string $siteaccess

Return Value

string

at line 197
public bool isUriPrefixExcluded(string $uri)

Checks if passed URI has an excluded prefix, when a root location is defined.

Parameters

string $uri

Return Value

bool

at line 217
public Location loadLocation(int $locationId)

Loads a location by its locationId, regardless to user limitations since the router is invoked BEFORE security (no user authenticated yet).

Not to be used for link generation.

Parameters

int $locationId

Return Value

Location