Good day. There is a MainController.php controller in which the function
/** * @Route("/main", name="main") */ public function showAction() { //Получение $records return $this->render("main.html.twig",array("record"=>$records)); } Next is the template main.html.twig in which the page is constructed from the transferred data:
<html> <body> <form method='post'> <!--//Построение страницы--> <input type="hidden" name="delete" value="yes"> <input type='submit' value='delete'> </form> </body> </html> I do not know how to accept the request from this form inside the controller. I wrote a function, I thought maybe she would catch
public function requestAction(Request $request) { echo $request->request->get('delete'); } But he doesn’t even get here, I don’t even make a Response or render return, if they don’t and they get into the function, he should throw it out, but he doesn’t throw anything out and it doesn’t show anything. The question is probably simple and stupid, but there may be symphonists who will not pass by and tell you how to catch the request from the form from the template in the controller)