Beta version

class UrlExtension extends Twig_Extension

Extension that allow render nodes, nodesSources and documents Url

Methods

__construct(Request $request, CacheProvider $cacheProvider = null, bool $forceLocale = false)

UrlExtension constructor.

string
getName()

No description

array
getFilters()

No description

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

No description

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

Convert an AbstractEntity to an Url.

string
getNodesSourceUrl(NodesSources $ns, array $criteria = array())

Get nodeSource url using cache.

string
getNodeUrl(Node $node, array $criteria = array())

Get node url using its first source.

Details

at line 56
__construct(Request $request, CacheProvider $cacheProvider = null, bool $forceLocale = false)

UrlExtension constructor.

Parameters

Request $request
CacheProvider $cacheProvider
bool $forceLocale

at line 66
string getName()

Return Value

string

at line 74
array getFilters()

Return Value

array

at line 87
string getCacheKey(NodesSources $ns, bool $absolute = false, string $canonicalScheme = '')

Parameters

NodesSources $ns
bool $absolute
string $canonicalScheme

Return Value

string

at line 106
string getUrl(AbstractEntity $mixed = null, array $criteria = array())

Convert an AbstractEntity to an Url.

Compatible AbstractEntity:

  • Document
  • NodesSources
  • Node

Parameters

AbstractEntity $mixed
array $criteria

Return Value

string

Exceptions

Twig_Error_Runtime

at line 137
string getNodesSourceUrl(NodesSources $ns, array $criteria = array())

Get nodeSource url using cache.

Parameters

NodesSources $ns
array $criteria

Return Value

string

at line 174
string getNodeUrl(Node $node, array $criteria = array())

Get node url using its first source.

Parameters

Node $node
array $criteria

Return Value

string