I want to replace spaces (%20) by "-" in Symfony 4.4 routes and delete first capital letter of my {slug}.
E.g:
RecipeController.php
/**
* @Route("/receta/{title}", name="recipe_show", methods={"GET"})
*/
public function show(Recipe $recipe): Response
{
return $this->render('recipe/show/show.html.twig', [
'recipe' => $recipe,
]);
}
Now my route shows it.
https://localhost:8000/receta/Pollo%20agridulce%20chino
But I would like to show
https://localhost:8000/receta/pollo-agridulce-chino
In my BD I save "Pollo agridulce chino"
How can I do it?