I have two properties with the same name from different tables declared in my GameType.php file.
But these are actually not the same values as the table columns Game.name and Type.name come from different tables.
How can I display both of them in the form without conflicts?
Snippet from GameType.php:
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add( 'name', TextType::class, [
'class' => 'AppBundle:Game',
'choice_label' => 'name',
] );
$builder
->add( 'name', EntityType::class, [
'class' => 'AppBundle:Type',
'choice_label' => 'name',
'multiple' => false,
'expanded' => false
] );
}
They're both called 'name' which causes the Type's selectbox to override the Game's TextField. I call the widget, but that's not working because they are both called 'name':
{{ form_widget(form.name) }}