junichi11 commented on issue #4869:
URL: https://github.com/apache/netbeans/issues/4869#issuecomment-1465083975
Unfortunately, we can't fix this case from the twig module.
```twig
<div class="container">
{% if nextmemberid == ''%}
<form action="{{
route('accmember',{_memberid:currentmember.memberid}) }}" method="POST">
<input type="hidden" name="memberid" value="{{
currentmember.memberid }}">
{% else %}
<form action="{{ route('accmember',{_memberid:nextmemberid}) }}"
method="POST">
<input type="hidden" name="memberid" value="{{ nextmemberid }}">
{% endif %}
</form>
</div>
```
If you close the HTML tag, maybe it works correctly.
e.g.
```twig
<div class="container">
{% if nextmemberid == ''%}
<form action="{{
route('accmember',{_memberid:currentmember.memberid}) }}" method="POST">
<input type="hidden" name="memberid" value="{{
currentmember.memberid }}">
</form>
{% else %}
<form action="{{ route('accmember',{_memberid:nextmemberid}) }}"
method="POST">
<input type="hidden" name="memberid" value="{{ nextmemberid }}">
</form>
{% endif %}
</div>
```
As a workaround:
Please use variables. **NOTE** I'm not an expert of twig.
```twig
{% if nextmemberid == ''%}
{% set example = 'foo' %}
{% set value = 'a' %}
{% else %}
{% set example = 'bar' %}
{% set value = 'b' %}
{% endif %}
<form action="{{ example }}" method="POST">
<input type="hidden" name="memberid" value="{{ value }}">
</form>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists