nette / latte

☕ Latte: the safest & truly intuitive templates for PHP. Engine for those who want the most secure PHP sites.
https://latte.nette.org
Other
1.09k stars 107 forks source link

Not possible define tags attributes dynamically with if anymore #308

Closed Kubina1232 closed 1 year ago

Kubina1232 commented 2 years ago

Version: 3.0.x-dev

Bug Description

After update to newest version of latte it is no longer possible define HTML tags atributes via if.

Steps To Reproduce

Check attachement code

Expected Behavior

Work as before -> no problem, successful compilation

BUG message

'Unexpected '</div>
   ' (on line 21 at column 18)'

Which corresponds to if in this tag

<input type="text" class="form-control"
                           name="username" id="username"
                           placeholder="{_"Username"}" required="required"
                           {if ($_ENV['ENVIRONMENT']== 'test')}
                               value="test"
                           {/if}
                           >

image image

dg commented 2 years ago

The problem is somewhere else https://fiddle.nette.org/latte/#ab560f0c17

dg commented 1 year ago

@Kubina1232 Did you find out where the problem is?

Kubina1232 commented 1 year ago

Unfortunately not. I have rewrote it to use variable.

Also now I see it is working locally with dev-master #f446 (so maybe so bug in some master build... who knows)