Sonata for administering sonata: weird with shortcuts

I installed the latest Sonata package for Symfony 2.1 and got the following problem: strange labels

config.yml:

services:
  app.geo.admin.city:
      class: App\GeoBundle\Admin\CityAdmin
      tags:
        - { name: sonata.admin, manager_type: orm, group:  , label: }
      arguments: [null, App\GeoBundle\Entity\City, SonataAdminBundle:CRUD]

Admin Class:   

class CityAdmin extends Admin
{
    public function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('name', null, array('required' => true))
            ->add('code')
            ->add('region')
            ->add('crest', 'file', array('required' => false))
            ->add('banner', 'file', array('required' => false))
            ->add('sort')
        ;
    }
}
+5
source share
1 answer

This is the behavior I encountered as well as a few weeks ago. I think it disappeared after the update.

It usually makes sense to explicitly add labels to fields, although

$formMapper
    ->add('name', null, array('required' => true, 
            'label' => 'Lastname'
        ));
+1
source

All Articles