title: Create route at user conveniance
body: <p>I need to create a small application with a homepage where the user can fill a form with a unique field. The field will be used as the name of a room, and the user redirected to this page. Every other user who enter the same room name will be redirected to the same page, and will be able to chat with users in this room.</p>
  
  <p>My problem is that I can't find a way with silex 2 to make this work.</p>
  
  <p>I created the homepage, and it seems to work. I have a form and can enter the name of the room : </p>
  
  <pre><code>$app-&gt;match(
  '/',
  function (Request $request) use ($app) {
      $data = array(
          'room' =&gt; 'Name of the room',
      );
  
      $form = $app['form.factory']-&gt;createBuilder(FormType::class, $data)
          -&gt;add('room', TextType::class)
          -&gt;getForm();
  
      $form-&gt;handleRequest($request);
  
      if ($form-&gt;isValid()) {
          $data = $form-&gt;getData();
          $roomName = $data['room'];
  
          //return $app-&gt;redirect('/room/' . $roomName);
          $subRequest = Request::create($app['url_generator']-&gt;generate('/room/' . $roomName), 'GET');
  
          return $app-&gt;handle($subRequest, \Symfony\Component\HttpKernel\HttpKernelInterface::SUB_REQUEST, false);
      }
  
      return $app['twig']-&gt;render('base.twig', array('form' =&gt; $form-&gt;createView()));
  }
  )-&gt;bind('home');
  </code></pre>
  
  <p>As you can see, I tried with redirect, and with a subrequest.
  But both case don't work, as I receive a 404.</p>
  
  <p>The code wich is suppose to catch the room is :</p>
  
  <pre><code>$app-&gt;match(
  '/room/{name}',
  function ($name) use ($app) {
      return $app['twig']-&gt;render('room.twig', array('name' =&gt; $name));
  }
  )-&gt;bind('room');
  </code></pre>
  
  <p>Does anyone have an idea on how I could make this work ?</p>
  
  <p>Thank you for reading. Any help will be appreciated.</p>