Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine
Next Chapter

Challenge #1 of 1


Q: 

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?

userVoice