symfony2 Catchable Fatal Error: Object of class could not be converted to string

前端 未结 5 611
眼角桃花
眼角桃花 2020-12-05 01:45

I have this Entity defined:



        
5条回答
  •  渐次进展
    2020-12-05 02:31

    For Symfony 3.x

    According with Symfony docs v3.x you should use choice_label property to specify the entity field name to be used here.

    ->add('categoryDescription', 'collection',
            array(
                'type'         => new CategoriesDescriptionType(),
                'allow_add' => true,
                'options'      => array('data_class' => 'Apw\BlackbullBundle\Entity\CategoriesDescription'),
                'choice_label' => 'name',
                'by_reference' => false,
    
            ))
    

提交回复
热议问题