title: Symfony2 Accessing route variables
body: <p>I know I can access current route name by <code>$request-&gt;get('_route');</code>.</p>
  
  <p>If my route is defined this way:</p>
  
  <pre><code>/*
   * @Route("/get_by_category/{id}", defaults={"id" = 0}, name="get_products_by_category")
   */
  </code></pre>
  
  <p>How can I retrieve the <code>id</code> variable from within service?</p>