getMapper(); $subject = $mapper->getAdmin()->getSubject(); if ($subject && $subject instanceof LocationInterface) { if ($mapper->hasOpenTab()) { $mapper ->end() ->end(); } $options = array( 'translation_domain' => 'MapBundle' ); $mapper ->tab('Map', $options) ->with('Location', $options) ->add('location', LocationType::class, array( 'label' => false, )) ->end() ->end(); } } /** * @param ConfigureEvent $event */ public function configureShowFields(ConfigureEvent $event) { $mapper = $event->getMapper(); $subject = $mapper->getAdmin()->getSubject(); if ($subject && $subject instanceof LocationInterface) { if ($mapper->hasOpenTab()) { $mapper ->end() ->end(); } $options = array( 'translation_domain' => 'MapBundle', ); if (!$mapper->has('location')) { $mapper ->tab('Map', $options) ->with('Location', $options) ->add('location', null, array( 'template' => 'LeafletBundle:CRUD:map_show_field.html.twig', 'translation_domain' => 'MapBundle', )) ->end() ->end(); } } } }