Kiedy utworzyć formularz wewnątrz mojego działania kontrolera jak ten:Symfony2: form_widget rozmowy gałązka rzuca wyjątek "połów fatal error ... musi być instancją Symfony Komponent Form FormView"
$form = $this->createFormBuilder()
->add('field_name')
->getForm();
return array(
'form' => $form
);
... i staram się uczynić tę formę w szablonie gałązka tak:
<form action="{{ path('...') }}" method="post">
{{ form_widget(form.field_name) }}
</form>
... The form_widget
inwokacja produkuje następujący wyjątek/błąd:
An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Argument 1 passed to Symfony\Component\Form\FormRenderer::searchAndRenderBlock() must be an instance of Symfony\Component\Form\FormView, instance of Symfony\Component\Form\Form given, called in ...
Jak mogę rozwiązać ten problem?
Twój przekazując formularz, kiedy należy zdać View – DevZer0