Answers for "symfony create route for controller"

PHP
1

twig symfony get route

{% set current_path = app.request.get('_route') %}
{{ current_path }}
Posted by: Guest on February-17-2020
3

symfony get path to route

// from controller method
$url = $this->generateUrl("route_name", array(
  "param1" => "value1",
  "param2" => "value2"/*, ... */
);

// from twig template
{{ path('route_name', {'param1': 'value1', 'param2': 'value2'}) }}
Posted by: Guest on March-09-2021

Code answers related to "symfony create route for controller"

Browse Popular Code Answers by Language