<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>yes</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>4.0</td>
</tr>
</tbody>
</table>
<p dir="auto">Hello,</p>
<p dir="auto">Following <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="203174106" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/21409" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/21409/hovercard" href="https://github.com/symfony/symfony/issues/21409">#21409</a>, I think it would be very more user-friendly to enable passing parameters as objects to Router::generate().<br>
Indeed, the user is used to get objects from parameters in the controller using explicit or implicit param converters, so it would be nice to be able to pass these very same objects to generate routes.<br>
It should be possible insofar the task of the Router is exactly managing controller arguments for making routes.</p>
<p dir="auto">For Symfony2 Router with the help of standart bundle (sensio extra) we can write ParamConverters to convert request param=&gt;object. Is there any standart way to use reversed convertion?</p>
<p dir="auto">Now we must do something like this:<br>
path('DevBlogBundle_post_show',{'post':post.id})<br>
While a better way would be:<br>
path('DevBlogBundle_post_show',{'post':post})</p>
<p dir="auto">I've found even example jist:<br>
<a href="https://gist.github.com/stevelacey/3226510">https://gist.github.com/stevelacey/3226510</a></p>
<ol dir="auto">
<li>Maybe, we should think about adding such functionality to future releases of, for example, sensioFrameworkExtra bundle?</li>
<li>If there is no such functionality, is bundle providing such extension would be needed?</li>
</ol>
<p dir="auto">Thanks.</p>