em = $em; $this->translatorAdmin = $translatorAdmin; } /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add( 'confirm', CheckboxType::class, [ 'translation_domain' => 'admin', ] ); $builder->add( 'delete', SubmitType::class ); } public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ // enable/disable CSRF protection for this form 'csrf_protection' => true, // the name of the hidden HTML field that stores the token 'csrf_field_name' => '_token', // an arbitrary string used to generate the value of the token // using a different string for each form improves its security 'csrf_token_id' => 'ea-delete', ]); } }