I want to use Symfony’s FormFactory for handling FormType and FormHandler.
Unfortunatly I don’t know what arguments are required to start the FormFactory service, I looked into the constructor of the Form-Class but there where allot of dependencies I can’t really order.
<service id="loc_article.form" factory-method="createNamed" factory-service="form.factory" class="Symfony\Component\Form\Form">
<argument></argument>
<argument></argument>
<argument />
</service>
<service id="loc_article.form.type" class="LOC\ArticleBundle\Form\Type\ArticleFormType">
<argument>LOC\ArticleBundle\Entity\Article</argument>
</service>
<service id="loc_article.form.handler" class="LOC\ArticleBundle\Form\Handler\ArticleFormHandler" scope="request" >
<argument type="service" id="loc_article.form" />
<argument type="service" id="request" />
<argument type="service" id="loc_article.manager" />
</service>
So what arguments do I have to pass?
CreateNamed method of
FormFactoryclass takesFormTypeand name of theFormTyperespectively.Edit:
Actually name is not related to
FormType. It can be any arbitrary name.Added service declaration.