Skip to content

Commit

Permalink
Update AbstractController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrombez authored Jan 10, 2024
1 parent a72edc6 commit e6ed199
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ public function createForm(string $type, mixed $data = null, array $options = []
return parent::createForm($type, $data, $options);
}

public function createFormBuilder(mixed $data = null, array $options = [], bool $autoAction = true): FormBuilderInterface
{
if ($autoAction) {
$options['action'] = $options['action'] ?? $this->requestStack->getCurrentRequest()->getUri();
}

return parent::createFormBuilder($data, $options);
}

protected function redirectToRoute(string $route, array $parameters = [], int $status = Response::HTTP_SEE_OTHER): RedirectResponse
{
return parent::redirectToRoute($route, $parameters, $status);
Expand Down

0 comments on commit e6ed199

Please sign in to comment.