class UrlExtension extends Twig_Extension (View source)

Extension that allow render documents Url

Properties

protected $forceLocale
protected $cacheProvider

Methods

__construct(RequestStack $requestStack, Packages $packages, UrlGeneratorInterface $urlGenerator, CacheProvider $cacheProvider = null, bool $forceLocale = false, bool $throwExceptions = false)

UrlExtension constructor.

string
getName()

No description

array
getFilters()

No description

string
getCacheKey(NodesSources $ns, bool $absolute = false, string $canonicalScheme = '') deprecated

No description

string
getUrl(AbstractEntity $mixed = null, array $criteria = [])

Convert an AbstractEntity to an Url.

string
getNodesSourceUrl(NodesSources $ns, array $criteria = []) deprecated

Get nodeSource url using cache.

string
getNodeUrl(Node $node, array $criteria = []) deprecated

Get node url using its first source.

Details

__construct(RequestStack $requestStack, Packages $packages, UrlGeneratorInterface $urlGenerator, CacheProvider $cacheProvider = null, bool $forceLocale = false, bool $throwExceptions = false)

UrlExtension constructor.

Parameters

RequestStack $requestStack
Packages $packages
UrlGeneratorInterface $urlGenerator
CacheProvider $cacheProvider
bool $forceLocale
bool $throwExceptions Trigger exception if using filter on NULL values (default: false)

string getName()

Return Value

string

array getFilters()

Return Value

array

string getCacheKey(NodesSources $ns, bool $absolute = false, string $canonicalScheme = '') deprecated

deprecated Use ChainRouter::generate method instead. In Twig you can use {{ path(nodeSource) }} or {{ url(nodeSource) }}

Parameters

NodesSources $ns
bool $absolute
string $canonicalScheme

Return Value

string

string getUrl(AbstractEntity $mixed = null, array $criteria = [])

Convert an AbstractEntity to an Url.

Compatible AbstractEntity:

  • Document

Parameters

AbstractEntity $mixed
array $criteria

Return Value

string

Exceptions

Twig_Error_Runtime

string getNodesSourceUrl(NodesSources $ns, array $criteria = []) deprecated

deprecated Use ChainRouter::generate method instead. In Twig you can use {{ path(nodeSource) }} or {{ url(nodeSource) }}

Get nodeSource url using cache.

Parameters

NodesSources $ns
array $criteria

Return Value

string

string getNodeUrl(Node $node, array $criteria = []) deprecated

deprecated Use ChainRouter::generate method instead. In Twig you can use {{ path(nodeSource) }} or {{ url(nodeSource) }}

Get node url using its first source.

Parameters

Node $node
array $criteria

Return Value

string