I have some immutable attributes on my entity to administrate with sonata-admin bundle.
I want to show them in the edit-view of the entity, but don\'t want to provide an
$formMapper
->add('post', 'entity',
array(
'label' => 'Some post',
'read_only' => true,
'disabled' => true,
'class' => 'Acme\DemoBundle\Entity\Post'
)
)
;
This answer tells how to customize list rendering. Maybe the same approach works with form rendering?
If not, then you can create your custom form type according to create custom field type documentation, and customizing the template.