Route parameters can be accessed in the following way in Twig:
{{ app.request.attributes }}
You can also use the [`dump()`](
[To see links please register here]
) function to see what methods are available:
<pre>
{{ dump(app.request.attributes) }}
</pre>
Here's a dump of all the parameters:
**Requesting URL**
[To see links please register here]
Route = test
Slug = {param1} = 3
**Twig Code**
{{ dump(app.request.attributes) }}
**Returns**
object(Symfony\Component\HttpFoundation\ParameterBag)[10]
protected 'parameters' =>
array (size=3)
'_controller' => string 'MyTest\Bundle\Controller\TestController::indexAction' (length=61)
'param1' => string '3' (length=1)
'_route' => string 'test' (length=7)