Skip to content

Commit 396004b

Browse files
committed
feat: 🎸 enable to pass formOptions to Context
1 parent 1390f19 commit 396004b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Context.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(Config $config, RequestStack $requestStack, FormFact
5757
$this->formFactory = $formFactory;
5858
}
5959

60-
public function initialize(string $sortKey = null, callable $slicer = null, callable $counter = null, AbstractCriteria $criteria = null, bool $handleRequest = true): void
60+
public function initialize(string $sortKey = null, callable $slicer = null, callable $counter = null, AbstractCriteria $criteria = null, array $formOptions = [], bool $handleRequest = true): void
6161
{
6262
$criteria = $criteria ?? new Criteria();
6363
$criteria->page = $criteria->page ?? 1;
@@ -67,9 +67,9 @@ public function initialize(string $sortKey = null, callable $slicer = null, call
6767

6868
$this->criteria = $criteria;
6969

70-
$this->form = $this->formFactory->createNamed('', $this->criteria->getFormTypeClass(), $this->criteria, [
70+
$this->form = $this->formFactory->createNamed('', $this->criteria->getFormTypeClass(), $this->criteria, array_merge([
7171
'method' => 'GET',
72-
]);
72+
], $formOptions));
7373

7474
if ($handleRequest) {
7575
$this->handleRequest();

0 commit comments

Comments
 (0)