How check conditions before remove action and set flash message in sonata-admin? I do not want remove super-user. My current code: public function preRemove($object) { parent::…
Tag: sonata-admin
Symfony 4: Use existing form type class in Sonata’s configureFormFields method
I know I can pull individual form elements from the type’s builder into the form mapper as described in the documentation: You can add Symfony FormBuilderInterface instances to the FormMapper. This allows you to re-use a model form type. When adding a field using a FormBuilderInterface, the type is guessed. Given you have a PostType like this: you can reuse
How to override Show field in sonata admin
I want show the list of multiple attributes Name => value in a table overriding single field of only for PortsAdmin in ShowMapper Ports Entity mapped with PortsAttributes Entity. Relation of entity is OneToMany Ports with multiple attributes. Admin View (Edit Action) Show Action I want change attribute view same as edit Action. Answer You can create a custom template
How is the best way to add select with choices to filters in Sonata Admin?
How is the best way to add select with choices to filters in Sonata Admin? For form i can: $builder->add(‘gender’, ‘choice’, array( ‘choices’ => array(‘m’ => ‘Male’, ‘f’ => ‘Female’…