Answer the question
In order to leave comments, you need to log in
What is the benefit of symfony forms?
If in the project all forms have complex html plus controls that appear, disappear, turn off, etc. (done in Angular) and are sent asynchronously, is there any point in creating a form class and trying to display it through
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}
if( $request->isMethod( 'POST' ) ) {
$em = $this->container->get( 'doctrine' )->getManager();
..................
.......
$em->persist( нечто );
$em->flush();
}
Answer the question
In order to leave comments, you need to log in
symfony forms are needed if symfony manages your forms (forms of any complexity, etc. are not a problem to make on it, but they will be more static).
If Angular stupidly sends you json - you don't have forms, you have json. There are other things for this.
Symphonic forms are very convenient for large static forms. If you build them in angular, then it's easier to do without them - just send json to the server, deserialize into entity, run through the validator and save.
If you really need to bind forms to entity fields, you can make some service that will return a list of entity fields in json and build a form on the front based on them
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question