Symfony2 Sonata Admin show attribute only as a readyonly text
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 any mechanism to change it (e.g. the value shall not be inside a input field) I couldn't find anything but this: $formMapper ->add('post', 'entity', array( 'label' => 'Some post', 'attr' => array( 'readonly' => true, 'disabled' => true ), 'class' => 'Acme\DemoBundle\Entity\Post' ) ) ; I tried it out with read_only , readonly , disabled etc. all the stuff. It looks ok, it's now inside a dropdown (since it is an entity) and I can