How to get the request parameters in Symfony 2?

后端 未结 16 1543
Happy的楠姐
Happy的楠姐 2020-12-02 05:02

I am very new to symfony. In other languages like java and others I can use request.getParameter(\'parmeter name\') to get the value.

Is there anything

16条回答
  •  既然无缘
    2020-12-02 05:32

    #www.example/register/admin

      /**
     * @Route("/register/{role}", name="app_register", methods={"GET"})
     */
    public function register(Request $request, $role): Response
    {
     echo $role ;
     }
    

提交回复
热议问题