Answer the question
In order to leave comments, you need to log in
How to access the value of an additional entity field in a form?
Hello!
There are entities Claim , Colors . Relationship Claim => ManyToOne => Colors by field Claim->color . Colors
has fields $id, $hex, $description .
I am building a form for creating a new Claim , displaying the colors as a list using the EntityType and options class=>Colors::class, choice_label=>description .
->add('color', EntityType::class, array(
'label' => 'Цвет',
'class' => Colors::class,
'choice_label' => 'description',
))
(style="background:$hex)
using php, not js. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question