[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/symfony/twig-bridge/Extension/ -> RoutingExtension.php (summary)

(no description)

File Size: 117 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

RoutingExtension:: (6 methods):
  __construct()
  getFunctions()
  getPath()
  getUrl()
  isUrlGenerationSafe()
  getName()


Class: RoutingExtension  - X-Ref

Provides integration of the Routing component with Twig.

__construct(UrlGeneratorInterface $generator)   X-Ref
No description

getFunctions()   X-Ref
{@inheritdoc}


getPath($name, $parameters = [], $relative = false)   X-Ref

param: string $name
param: array  $parameters
param: bool   $relative
return: string

getUrl($name, $parameters = [], $schemeRelative = false)   X-Ref

param: string $name
param: array  $parameters
param: bool   $schemeRelative
return: string

isUrlGenerationSafe(\Twig_Node $argsNode)   X-Ref
Determines at compile time whether the generated URL will be safe and thus
saving the unneeded automatic escaping for performance reasons.

The URL generation process percent encodes non-alphanumeric characters. So there is no risk
that malicious/invalid characters are part of the URL. The only character within an URL that
must be escaped in html is the ampersand ("&") which separates query params. So we cannot mark
the URL generation as always safe, but only when we are sure there won't be multiple query
params. This is the case when there are none or only one constant parameter given.
E.g. we know beforehand this will be safe:
- path('route')
- path('route', {'param': 'value'})
But the following may not:
- path('route', var)
- path('route', {'param': ['val1', 'val2'] }) // a sub-array
- path('route', {'param1': 'value1', 'param2': 'value2'})
If param1 and param2 reference placeholder in the route, it would still be safe. But we don't know.

param: Node $argsNode The arguments of the path/url function
return: array An array with the contexts the URL is safe

getName()   X-Ref
{@inheritdoc}




Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1