snipt

Ctrl+h for KB shortcuts

PHP

Symfony 1.x : Generate URL in controller

1
2
3
<?php

$url = $this->getController()->genUrl("@user_route", true);
https://snipt.net/embed/7d4e0a5fef26679ec5d074d0e41fdad6/
/raw/7d4e0a5fef26679ec5d074d0e41fdad6/
7d4e0a5fef26679ec5d074d0e41fdad6
php
PHP
3
2016-12-31T13:56:48
True
False
True
Sep 02, 2012 at 05:45 AM
/api/public/snipt/46602/
symfony-1x-generer-une-url-dans-une-action
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nv">$url</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">getController</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">genUrl</span><span class="p">(</span><span class="s2">&quot;@user_route&quot;</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span> </span></pre></div> </td></tr></table>
Symfony, action, url