'Symfony form EntityType class
I am preparing a form for the user's choice of a game according to selected parameters. I am using the EntityType class.
Example:
///...
-> add ('Age_of_years', EntityType :: class, [
' required '=> false,
' label '=>' Age from years: ',
' class' => Game :: class,
'choice_label' => 'Age_of_years ',
' expanded '=> true,
' multiple '=> false,])
Many games are assigned the same minimum age and when borrowing from the database, the same values appear in the form many times. Surely there is a way to avoid it?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|