-
-
Notifications
You must be signed in to change notification settings - Fork 149
Create n:name tag/macro form in Latte 3 directly in HTML <form> tag #291
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
Comments
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
dg
added a commit
that referenced
this issue
Dec 27, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bridge for Latte 3, NNameNode
Move variable assignment
$form = $this->global->formsStack[] = $this->global->uiControl['formForm']
directly into the HTML<form>
tag in Latte 3 seems unfortunate to me. Apart from taking advantage of the fact that the variable is created before the tag itself (it could be conditioned based on some form property, for example), this clashes with the n:tag-if condition set on the form. There is a crash rendering of the termination tagecho Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack), false)
, where it reaches into$this->global->formsStack
, but it doesn't exist because the creation of the form tag is conditional and doesn't happen at all.For a better understanding, see the script generated into PHP using
<form n:tag-if="$someCondition" n:name="formForm">
Possible Solution
I suggest moving the assignment
$form = $this->global->formsStack[] = $this->global->uiControl['formForm']
back before the HTML form tag as in Latte 2.The text was updated successfully, but these errors were encountered: