Answers for "get route symfony"

0

symfony console get all routes

$ php bin/console debug:router

------------------ -------- -------- ------ ----------------------------------------------
 Name               Method   Scheme   Host   Path
------------------ -------- -------- ------ ----------------------------------------------
 homepage           ANY      ANY      ANY    /
 contact            GET      ANY      ANY    /contact
 contact_process    POST     ANY      ANY    /contact
 article_show       ANY      ANY      ANY    /articles/{_locale}/{year}/{title}.{_format}
 blog               ANY      ANY      ANY    /blog/{page}
 blog_show          ANY      ANY      ANY    /blog/{slug}
------------------ -------- -------- ------ ----------------------------------------------
Posted by: Guest on April-07-2021
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