title: How to pass Array in symfony route?
body: <p>I have a function in my controller that takes an array as input. The value is passed from ajax. At the moment it is not being decoded correctly.</p>
  
  <pre><code> /**
   * @Route("/userLogin/{params}", name="userLogin", methods={"POST"})
   * @param UserdbRepository $repository
   * @param $params
   * @return \Symfony\Component\HttpFoundation\Response
   */
  
  public function userLogin(UserdbRepository $repository, $params) {
  
     $email = $params[0];
     $pass = $params[1];
  
     print_r($params);  // output correct value test@test.com
     echo $params[0];   // output t
     echo $email;       // output t
  
     .... rest of code
  }
  </code></pre>
  
  <p>js:</p>
  
  <pre><code> const array = [ 'email', 'pass' ]
  
   $.ajax({
      url: `/userLogin/${array}`,
      type: "post",
      dataType: 'json'
  })
  </code></pre>