title: Bester way to switch case a route
body: <p>is there a better, or more efficient way to call a method from the variable of the route:</p>
  
  <pre><code>$app-&gt;get('/ac/{route}', function (Request $request, $route) use ($app) {
  
      switch ($route) {
          case 'formejur':
              $infos = $app['manager.ac']-&gt;getPropFormejur( $request-&gt;get('find') );
              break;
  
          case 'naf':
              $infos = $app['manager.ac']-&gt;getPropNaf( $request-&gt;get('find') );
              break;
  
          case 'fonction':
              $infos = $app['manager.ac']-&gt;getPropFonction( $request-&gt;get('find') );
              break;
  
          case 'ville':
              $infos = $app['manager.ac']-&gt;getPropVille( $request-&gt;get('find') );
              break;
  
          case 'dep':
              $infos = $app['manager.ac']-&gt;getPropDepartement( $request-&gt;get('find') );
              break;
  
          default: break;
      }
  
      $response = new JsonResponse();
      $response-&gt;setData($infos);
  
      return $response-&gt;getContent();
  });
  </code></pre>
  
  <p>It is only the method of $app['manager.ac'] who change.</p>