title: Symfony2: use object to set route parameters
body: <p>I have a route with 2 parameters:</p>
  
  <pre><code>BBBundle_blog_show:
      pattern:  /{id}/{slug}
      defaults: { _controller: BloggerBlogBundle:Blog:show }
      requirements:
          _method: GET
          id: \d+
  </code></pre>
  
  <p>Both params are properties of an object <strong>blog</strong>.</p>
  
  <p>I would like to set up a custom mapper (route generator), so that I can write this: </p>
  
  <pre><code> {{ path('BBBundle_blog_show', {'blog': blog}) }}
  </code></pre>
  
  <p>instead of this:</p>
  
  <pre><code> {{ path('BBBundle_blog_show', {'id':blog.id, 'slug':blog.slug) }}
  </code></pre>