Вот как вы это реализуете: https://sonata -project.org / bundles / formatter / master / doc / reference / formatter_widget.html
Пример моего кода:
source_field -> body => existing entity field
format_field -> formattedBody => create new field in entity
target_field -> body => existing entity field
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('body', 'sonata_formatter_type', array(
'event_dispatcher' =>
$formMapper->getFormBuilder()->getEventDispatcher(),
'format_field' => 'formattedBody',
'format_field_options' => array(
'choices' => array('richhtml'),
'data' => 'richhtml',
),
'source_field' => 'body',
'source_field_options' => array(
'attr' => array(
'class' => 'span10',
'rows' => 20,
),
),
'listener' => true,
'target_field' => 'body',
))