title: 'Twig_Error_Syntax' with message Unknown "form_start" function
body: <p>Is it possible to make a <em>standalone</em> form with symfony3 and twig? I can't get past this error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "form_start" function in "new.html.twig" at line 1</p>
  </blockquote>
  
  <p>The <a href="https://symfony.com/doc/current/components/form/introduction.html" rel="nofollow noreferrer">3.1 documentation</a> cites <a href="https://github.com/webmozart/standalone-forms" rel="nofollow noreferrer">this example</a>, which works fine, but it's actually using 2.7</p>
  
  <p><a href="https://github.com/webmozart/standalone-forms" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2balT.png" alt="screenshot of example"></a></p>
  
  <p>My simple project is organized like this:</p>
  
  <pre><code>.
  ├── composer.json
  ├── composer.lock
  ├── src
  │   └── form.php
  ├── vendor
  │   └── ...
  └── views
      └── new.html.twig
  </code></pre>
  
  <h1><code>form.php</code></h1>
  
  <pre><code>&lt;?php
  require_once __DIR__.'/../vendor/autoload.php';
  
  use Symfony\Component\Form\Forms;
  use Symfony\Bridge\Twig\Extension\FormExtension;
  use Symfony\Bridge\Twig\Form\TwigRenderer;
  use Symfony\Bridge\Twig\Form\TwigRendererEngine;
  
  // the Twig file that holds all the default markup for rendering forms
  // this file comes with TwigBridge
  $defaultFormTheme = 'form_div_layout.html.twig';
  
  $vendorDir = realpath(__DIR__.'/../vendor');
  // the path to TwigBridge library so Twig can locate the
  // form_div_layout.html.twig file
  $appVariableReflection = new \ReflectionClass('\Symfony\Bridge\Twig\AppVariable');
  $vendorTwigBridgeDir = dirname($appVariableReflection-&gt;getFileName());
  // the path to your other templates
  $viewsDir = realpath(__DIR__.'/../views');
  
  $twig = new Twig_Environment(new Twig_Loader_Filesystem(array(
      $viewsDir,
      $vendorTwigBridgeDir.'/Resources/views/Form',
  )));
  $formEngine = new TwigRendererEngine(array($defaultFormTheme));
  $formEngine-&gt;setEnvironment($twig);
  
  // create your form factory as normal
  $formFactory = Forms::createFormFactoryBuilder()
      -&gt;getFormFactory();
  
  use Symfony\Component\Form\Extension\Core\Type\TextType;
  use Symfony\Component\Form\Extension\Core\Type\DateType;
  
  $form = $formFactory-&gt;createBuilder()
      -&gt;add('task', TextType::class)
      -&gt;add('dueDate', DateType::class)
      -&gt;getForm();
  
  var_dump($twig-&gt;render('new.html.twig', array(
      'form' =&gt; $form-&gt;createView(),
  )));
  </code></pre>
  
  <h1><code>new.html.twig</code></h1>
  
  <pre><code>{{ form_start(form) }}
      {{ form_widget(form) }}
  
      &lt;input type="submit" /&gt;
  {{ form_end(form) }}
  </code></pre>
  
  <h1><code>composer.json</code></h1>
  
  <pre><code>{
      "require": {
          "symfony/form": "^3.1",
          "symfony/twig-bridge": "^3.1",
          "twig/twig": "^1.24"
      }
  }
  </code></pre>
  
  <hr>
  
  <h1>Full Error Stack Trace</h1>
  
  <pre><code>Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "form_start" function in "new.html.twig" at line 1.' in /var/www/a/forms/vendor/twig/twig/lib/Twig/ExpressionParser.php:574
  Stack trace:
  #0 /var/www/a/forms/vendor/twig/twig/lib/Twig/ExpressionParser.php(351): Twig_ExpressionParser-&amp;gt;getFunctionNodeClass('form_start', 1)
  #1 /var/www/a/forms/vendor/twig/twig/lib/Twig/ExpressionParser.php(144): Twig_ExpressionParser-&amp;gt;getFunctionNode('form_start', 1)
  #2 /var/www/a/forms/vendor/twig/twig/lib/Twig/ExpressionParser.php(84): Twig_ExpressionParser-&amp;gt;parsePrimaryExpression()
  #3 /var/www/a/forms/vendor/twig/twig/lib/Twig/ExpressionParser.php(41): Twig_ExpressionParser-&amp;gt;getPrimary()
  #4 /var/www/a/forms/vendor/twig/twig/lib/Twig/Parser.php(144): Twig_ExpressionParser-&amp;gt;parseExpression()
  #5 /var/www/a/forms/vendor/twig/twig/lib/Twig/Parser.php(100): Twig_Parser-&amp;gt;subparse(NULL, false)
  #6 /var/www/a/forms/vendor/twig/twig/lib/Twig/Environment.php(619): Twig_Parser-&amp;gt;parse(Object(Twig_TokenStream))
  #7 /var/www/a/forms/ in /var/www/a/forms/vendor/twig/twig/lib/Twig/ExpressionParser.php&lt;/b&gt; on line 574
  </code></pre>