-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
First, I know that form containers may not be fully supported yet, see #380, but this may or may not be directly related so I'm still filing this.
I have a form with multiple containers (they're nested but that's unrelated I think)
This is how I build the containers, notice the for loop and addContainer($i):
$disclosureNewContainer = $disclosureContainer->addContainer('new');
for ($i = 0; $i < $newDisclosures; $i++) {
$disclosureNewCountContainer = $disclosureNewContainer->addContainer($i);In a template:
{formContainer new}
{formContainer $i} <-- line 85This is how it's compiled by the extension:
/* line 84 */
$this->global->formsStack[] = $formContainer = $form['new'];
/* line 85 */
$this->global->formsStack[] = $formContainer = \Nette\Bridges\FormsLatte\Runtime::item($i, $this->global);
I get this error on level 5:
------ ---------- ---------------------------------------------------------------------------------------------------------------------------------------------
Line Compiled Admin/Presenters/templates/Pulse/passwordsStorages.latte rendered from MichalSpacekCz\Admin\Presenters\PulsePresenter::passwordsStorages
line See compiled template: /tmp/phpstan-latte/app/Admin/Presenters/templates/Pulse/passwordsStorages.latte.8f4b78add10adffe699f7ad521d7e14e.php
------ ---------- ---------------------------------------------------------------------------------------------------------------------------------------------
85 437 Parameter #1 $item of static method Nette\Bridges\FormsLatte\Runtime::item() expects object|string, int<0, 2> given.
------ ---------- ---------------------------------------------------------------------------------------------------------------------------------------------
I'm not sure where object|string is coming from, because \Nette\Bridges\FormsLatte\Runtime::item($item, $global): object doesn't use any type declarations at all: https://github.com/nette/forms/blob/8a23250f05443cae8b7c8294003c3f2a9d38ffc5/src/Bridges/FormsLatte/Runtime.php#L115
And eventually does this
return $form[$item];Metadata
Metadata
Assignees
Labels
No labels