First of all, the error is returned because the `__toString()` class is not overridden. So, let make it!
//Acme\Bundle\DemoBundle\Entity\RolesIn order to make a checkbox of the roles available, we should specify true values for `expanded`, `compound`, and `multiple`
function __toString()
{
return $this->getName();
}
//Acme\Bundle\DemoBundle\Admin\UsersAdmin
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('Roles','sonata_type_model',array(
'expanded' => true,
'compound' => true,
'multiple' => true))
; }
No comments:
Post a Comment