<p dir="auto">At the moment the Routing component only supports absolute and domain-relative URLs, e.g.<br>
<code class="notranslate">http://example.org/user-slug/article-slug/comments</code> and<br>
<code class="notranslate">/user-slug/article-slug/comments</code>.</p>
<p dir="auto">But I find it very useful to specify path-relative URLs that depend on the current request path. Lets say the client requests <code class="notranslate">http://example.org/user-slug/article-slug/</code> and I want to generate a link to the comments of the same article.<br>
Currently the resulting link would again duplicate the <code class="notranslate">user-slug</code> and <code class="notranslate">article-slug</code> -&gt; <code class="notranslate">/user-slug/article-slug/comments</code>.<br>
But it could be simplified to <code class="notranslate">comments</code> or <code class="notranslate">./comments</code>.</p>
<p dir="auto">One additional feature that could be implemented is a new twig function (besides <code class="notranslate">url</code> and <code class="notranslate">path</code>) lets call it <code class="notranslate">subpath</code>.<br>
It fetches the variables of the current request, e.g. <code class="notranslate">user-slug</code> and <code class="notranslate">article-slug</code> internally and then generates such a relative URL. The advantage is you don't need to specify the variables of the current request again.<br>
So simply <code class="notranslate">{{ subpath('article_comments') }}</code> is enough for the URL <code class="notranslate">./comments</code>. But you can optionally overwrite  some request variables with <code class="notranslate">{{ subpath('article_comments', {'article': 'different-article-slug'} ) }}</code> which would generate <code class="notranslate">../different-article-slug/comments</code> (i.e. same user, but different article).</p>
<p dir="auto">Thinking of it, the twig function is also a quite useful without the path-relative URLs. So these are basically two feature requests.<br>
I already  got an idea how to implement this but would like to get your feedback whether one of these features is also useful to others.</p>
<p dir="auto">Some where between Merge to 2.8 and 3.1, someone made changes to TraceEventDispatcher.php file. The sprintf command was removed and replaced with <em>{event}</em> and <em>{listener}</em> in message. Like they are some how going to magically change.</p>
<p dir="auto"><strong>Previous (3.0.9)</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  *FILE: ./symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
 267   :                    $this-&gt;logger-&gt;debug(sprintf('Notified event &quot;%s&quot; to listener &quot;%s&quot;.', $eventName, $info['pretty']));"><pre class="notranslate"><code class="notranslate">  *FILE: ./symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
 267   :                    $this-&gt;logger-&gt;debug(sprintf('Notified event "%s" to listener "%s".', $eventName, $info['pretty']));
</code></pre></div>
<p dir="auto"><strong>Current (3.1.5)</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="FILE: ./symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
 267   :                    $this-&gt;logger-&gt;debug('Notified event &quot;{event}&quot; to listener &quot;{listener}&quot;.', array('event' =&gt; $eventName, 'listener' =&gt; $info['pretty']));"><pre class="notranslate"><code class="notranslate">FILE: ./symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php
 267   :                    $this-&gt;logger-&gt;debug('Notified event "{event}" to listener "{listener}".', array('event' =&gt; $eventName, 'listener' =&gt; $info['pretty']));
</code></pre></div>
<p dir="auto"><strong>OUTPUT 3.0.9</strong>:<br>
<code class="notranslate">Notified event "kernel.request" to listener "Dst\AuthBundle\EventListener\RequestListener::onKernelRequest".</code></p>
<p dir="auto"><strong>OUTPUT 3.1.5</strong>:<br>
<code class="notranslate">Notified event "{event}" to listener "{listener}".</code></p>