Answers for "symfony get path to route"

PHP
1

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

Browse Popular Code Answers by Language