Is it possible to add twig directives to field options in a Sonata Admin field option?
$fileFieldOptions = array('required' => false, 'data_class' => null);
if ($image && ($webPath = $image->getS3PathToImage())) {
// get the container so the full path to the image can be set
$container = $this->getConfigurationPool()->getContainer();
$fullPath = 'http://'.$webPath;
// add a 'help' option containing the preview's img tag
//$fileFieldOptions['help'] = '<img src="'.$fullPath.'" class="admin-preview" />';
$fileFieldOptions['help'] = "<img src='{{ '/relative/path/to/image.jpg' | imagine_filter('gi_thumb') }}' />";
I tried safe => true as suggested here but it does not seem to work with form fields.