Answer the question
In order to leave comments, you need to log in
How will it be right?
Started learning Symfony. But before that I sat on Yii2. Therefore, the study is in comparison. And in connection with this, questions arose. I'm interested in how this is accepted in Symfony. And specifically in version 4. I would like to immediately go on the right path, and not on the path of a rake.
Answer the question
In order to leave comments, you need to log in
1. Where is more convenient for you. Annotations are just one way to store configuration.
2. From the situation. Forms do not need an entity, but some kind of class (and then, optionally) to map the data. And here also, as you prefer. For example, a form for deletion, boldly in the controller, for editing in a separate class that can be reused.
3. Holivara question. I saw people foaming at the mouth arguing that everything needs to be written in types, and others who have forms with a total number of fields exceeding 300, where only fields are registered ... It's also all from the situation. If this form will be reused, there will be different validation groups, handlers will be different, then it makes sense to leave them minimally loaded and take everything out, and vice versa, if the form is extremely specific, then it is better not to spread work with it over the application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question