title: How can I register a custom form field type in Silex / Twig?
body: <p>My App ist running, but when I use a custom Form-Field-Type (shtumi_daterange) like:</p>
  
  <pre><code>public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options)
  {
      $dateRange4 = new DateRange('m/d/Y');
      $dateRange4-&gt;parseData('03/27/2012 - 04/05/2012');
      $builder-&gt;add('builddate', "shtumi_daterange", array('required'=&gt;false, 'default'=&gt;$dateRange4));
  }
  </code></pre>
  
  <p>the this error occurs:</p>
  
  <pre><code>Uncaught exception 'Symfony\Component\Form\Exception\FormException' with 
  message 'Could not load type "shtumi_daterange"' in 
  ../vendor/symfony/form/Symfony/Component/Form/FormRegistry.php:95
  </code></pre>
  
  <p>I think, I need something like:</p>
  
  <pre><code>&lt;?php
  $app-&gt;register(new Silex\Provider\TwigServiceProvider(), array(
      'twig.path'        =&gt; $path_ext_dir_abs . '/views',
  'twig.form.templates' =&gt; array('form_div_layout_custom.html.twig'),
      'form.type.shtumi_daterange' =&gt; 'Shtumi\UsefulBundle\Form\Type\DateRangeType',
  ));
  </code></pre>
  
  <p>but I just dont know/find the right symtax!</p>
  
  <p>From the <a href="http://symfony.com/doc/current/cookbook/form/create_custom_field_type.html" rel="nofollow">symfony documentation</a>, I found this example how to register a custom form field type, but I can't transform this to get it run with silex:</p>
  
  <pre><code>services:
  
    form.type.gender:
        class: Acme\DemoBundle\Form\Type\GenderType
        arguments:
            - "%genders%"
        tags:
            - { name: form.type, alias: gender }
  </code></pre>