Skip to content

Commit

Permalink
✨ add possibility to pass options to form
Browse files Browse the repository at this point in the history
  • Loading branch information
garak committed Sep 5, 2022
1 parent 11605c0 commit 3682b79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ public function getFormView(string $name, ?string $type = null): FormView

/**
* Save filtered values from form into session.
* Possible default values for empty fields can be passed as last argument.
* Possible default values for empty fields can be passed as third argument.
*
* @param array<string, mixed> $defaults
* @param array<string, mixed> $options
*/
public function saveFilter(string $type, string $name, array $defaults = []): bool
public function saveFilter(string $type, string $name, array $defaults = [], array $options = []): bool
{
$fname = $name.$this->getSession()->getId();
$this->forms[$fname] = $this->formFactory->create($type);
$this->forms[$fname] = $this->formFactory->create($type, null, $options);
if ($this->getRequest()->query->has('reset-filter')) {
$this->getSession()->set('filter.'.$name, null);

Expand Down

0 comments on commit 3682b79

Please sign in to comment.