문제

I tried to following this tutorial: http://sonata-project.org/bundles/doctrine-orm-admin/master/doc/reference/form_field_definition.html#advanced-usage-many-to-one to create many-to-one form field.

But after the object is selected, i got strange selected value like in the screenshot below.

enter image description here

The entity StyleCategory had property name, i want it showed there instead the FQCN. How to do it?

도움이 되었습니까?

해결책

In your StyleCategory entity add method :

public function __toString(){
    return $this->name
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top