Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow get parameters to be set when creating an action for the DeleteType #2973

Merged
merged 2 commits into from
Mar 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Backend/Form/Type/DeleteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ class DeleteType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->setAction(Model::createUrlForAction($options['action'], $options['module']));
$builder->setAction(
Model::createUrlForAction(
$options['action'],
$options['module'],
null,
$options['get_parameters']
)
);

$builder->add($options['id_field_name'], HiddenType::class);
}
Expand All @@ -28,6 +35,7 @@ public function configureOptions(OptionsResolver $resolver): void
$resolver->setDefaults([
'action' => 'Delete',
'id_field_name' => 'id',
'get_parameters' => [], // Get parameters to be added to the generated action url
]);
}
}