title: Symfony query into friendly Url
body: <p>I am trying to make a stock control app using Symfony 3.1.1 from a similar app.</p>
  
  <p>The customer wants that all the url have this pattern </p>
  
  <p>domain/suppliers/2 </p>
  
  <p>(where 2 is the id of the supplier in the database)</p>
  
  <p>At the moment, the url I am obtaining is something like </p>
  
  <p>domain/supplier?id=2</p>
  
  <p>I have been looking through documentation of the old project, symfony page and here, but I can't understand how can I routing, as the project is a fork of another one I am constrained to keep as much code as I can.</p>
  
  <p>All the code extends from a Bundle, so for make a list it is calling this function (I am not overwritten or adding anything to the SupllierController at the moment):</p>
  
  <pre><code>     * @Route("")
   */
  public function listAction(Request $request)
  {
      $list = $this-&gt;createList($this-&gt;getListObject());
      $list-&gt;handleRequest($request)-&gt;process();
      $list-&gt;setTemplatesScope($this-&gt;getTemplatesScope() . ':Listing\\');
  
      if ($request-&gt;isXmlHttpRequest()) {
          return new JsonResponse($list-&gt;getInfo());
      } else {
          return $this-&gt;render($this-&gt;getTemplatesScope().':list.html.twig', $list-&gt;render());
      }
  }
  </code></pre>
  
  <p>The list that is called by the controller is very simple, all my changes are related with the creation of a button where I try to take de id of the suplier:</p>
  
  <pre><code> &lt;a href="{{ path('app_supplierproduct_list', { id : row.id }) }}" class="btn btn-default"&gt;
              Productos
          &lt;/a&gt;
  </code></pre>
  
  <p>The SupplierProductList (that I am trying to call) is:</p>
  
  <pre><code>public function buildList(ListBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;setEntity('AppBundle:SupplierProduct')
              -&gt;setMode('normal', 'modal')
              -&gt;addField('products', 'entity', [
                  'label'             =&gt; 'Producto',
                  'class'             =&gt; 'AppBundle:Product',
                  'choice_label'      =&gt; 'name',
                  'query_builder' =&gt; function (EntityRepository $er) {
                      return $er-&gt;createQueryBuilder('e')
                      -&gt;orderBy('e.name', 'ASC');
                  },
              ])
              -&gt;addField('supplier', 'entity', [
                  'label'             =&gt; 'Proveedor',
                  'class'             =&gt; 'AppBundle:Supplier',
                  'choice_label'      =&gt; 'name',
                  'query_builder' =&gt; function (EntityRepository $er) {
                      return $er-&gt;createQueryBuilder('e')
                      -&gt;orderBy('e.name', 'ASC');
                  },
              ])      
              -&gt;addField('name', 'text', [
                  'label'             =&gt; 'Nombre en el Proveedor',
              ])
              -&gt;addField('code', 'text', [
                  'label'             =&gt;  'Código en el Proveedor',
              ])
              -&gt;addFilter('name', 'text', [
                  'label'             =&gt; 'Nombre en el proveedor',
              ])
              -&gt;addFilter('sku', 'text', [
                  'label'            =&gt;   'Código interno del proveedor'
              ])
              -&gt;addFilter('updatedAt', 'date', [
                  'label'             =&gt; 'Última Modificación'
              ])            
              -&gt;addFilter('supplier', 'entity', [
                  'label'             =&gt; 'Proveedor',
                  'class'             =&gt; 'AppBundle:Supplier',
                  'choice_label'      =&gt; 'name',
                  'query_builder' =&gt; function (EntityRepository $er) {
                      return $er-&gt;createQueryBuilder('e')
                      -&gt;orderBy('e.name', 'ASC');
                  },
  
              ])
              -&gt;addFilter('customer', 'entity', [
                  'label'             =&gt; 'Cliente',
                  'class'             =&gt; 'AppBundle:Customer',
                  'choice_label'      =&gt; 'name',
                  'query_builder' =&gt; function (EntityRepository $er) {
                      return $er-&gt;createQueryBuilder('e')
                      -&gt;orderBy('e.name', 'ASC');
                  },
              ])
          ;
      }
  
      /**
       * {@inheritdoc}
       */
      public function getName()
      {
          return 'list_supplierproduct';
      }
  </code></pre>
  
  <p>routing file:</p>
  
  <pre><code>app_supplier_customer:
      resource: "@AppBundle/Controller/SupplierCustomerController.php"
      type:     annotation
  
  app_supplier_customer:
      resource: "@AppBundle/Controller/SupplierCustomerController.php"
      type:     annotation
  
  app_supplier_customer:
      resource: "@AppBundle/Controller/SupplierCustomerController.php"
      type:     annotation
  
  app_supplier_product:
      resource: "@AppBundle/Controller/SupplierProductController.php"
      type:     annotation
  
  app_supplier_customer:
      resource: "@AppBundle/Controller/SupplierCustomerController.php"
      type:     annotation
  
  app_sale:
      resource: "@AppBundle/Controller/SaleController.php"
      type:     annotation
  
  app_product:
      resource: "@AppBundle/Controller/ProductController.php"
      type:     annotation
  
  app_group:
      resource: "@AppBundle/Controller/GroupController.php"
      type:     annotation
  
  app_customer:
      resource: "@AppBundle/Controller/CustomerController.php"
      type:     annotation
  
  app_brand:
      resource: "@AppBundle/Controller/BrandController.php"
      type:     annotation
  
  odin_form_filemanager:
       path:  /filemanager/
       defaults: { _controller: OdinFormBundle:FileManager:show }
  
  odin_panel:
      resource:       '@OdinPanelBundle/Controller'
  
  
  odin_panel_login_check:
      path:           /login/check
  
  
  odin_panel_logout:
      path:           /logout
      app:
          resource: '@AppBundle/Controller/'
          type:     annotation
  </code></pre>