Category : sonata-admin

I’ve installed sonata + symfony 4.4 on new clean empty project. Did everything according to https://symfony.com/doc/current/bundles/SonataAdminBundle/getting_started/installation.html and executed the recipes , composer adviced me to apply. But on pristine setup I’m having a few deprecations like: User Deprecated: The "sonata.twig.deprecated_template_extension" service is deprecated since sonata-project/twig-extensions 1.4. User Deprecated: The "sonata.deprecated_text.twig.extension" service is deprecated since sonata-project/admin-bundle ..

Read more

I have a field on my form in Sonata Admin: protected function configureFormFields(FormMapper $formMapper) { $formMapper ->add(‘filePath’, TextType::class, [ ‘disabled’ => true, ]); } protected function configureShowFields(ShowMapper $showMapper) { $showMapper ->add(‘filePath’); } This relates to an entity which stores the path of a file. class User { /** * @ORMColumn(type="string", nullable=true) */ private $filePath; How ..

Read more

I’m using the ChoiceFieldMaskType from Sonata. I want to display some fields when one field true. Here’s what I’ve done: ->add(‘hasArtist’, ChoiceFieldMaskType::class, [ ‘label’ => ‘Mettre un artiste sur l’article?’, ‘choices’ => [ ‘Oui’ => ‘true’, ‘Non’ => ‘false’, ], ‘map’ => [ ‘true’ => [‘artistName’, ‘artistText’,’artistLink’,’artistImage’], ], ‘required’ => true ]) ->add(‘artistName’, TextType::class, [‘required’ ..

Read more