title: How to generate absolute URL in custom form type?
body: <p>I have example custom form type:</p>
  
  <pre><code>namespace Acme\SimpleBundle\Form\Type;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  
  class ExampleType extends AbstractType
  {
  
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
  
          $builder-&gt;setAction(****-----GENERATE-ROUTE-ABSOLUTE-URL-HERE-----****)
                  -&gt;add('email', 'text')
                  -&gt;add('send', 'submit');
      }
  
      public function getName()
      {
           return 'example';
      }
  
      public function setDefaultOptions(OptionsResolverInterface $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'error_bubbling' =&gt; true
          ));
      }
  
  }
  </code></pre>
  
  <p>How can I generate absolute URL (like <a href="http://example.com/admin/check_form" rel="nofollow noreferrer">http://example.com/admin/check_form</a>) to my route?</p>
  
  <p><code>$this-&gt;generateUrl()</code> doesn't work, becuse it's not a controller, and <code>$this-&gt;get('router')-&gt;generate()</code> also doesn't work, I don't know why.</p>