Start your All-Access Pass to unlock this challenge
Suppose we have the following field:
yield AssociationField::new('topic')
->setFormTypeOption('choice_label', 'name')
->formatValue(function($value, Topic $topic) {
return 'Topic: '.$topic->getName();
});
Also, the __toString()
method in Topic
looks like this:
public function __toString(): string
{
return 'Topic name: '.$this->name;
}
Assuming that a Question
is related to a Topic
whose name
is "Cake", which of the following is true about how the topic
field will be rendered?