We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version: 2.9.2, 2.10.0
Parser throws: Latte\CompileException: Cannot redeclare block 'someBlock' in ...
Latte\CompileException: Cannot redeclare block 'someBlock' in ...
Run Latte with this code in a template file:
{define aaa} <span>{block someBlock}{/block}</span> {/define} {embed aaa} {if 3 === 4} {block someBlock}a{/block} {else} {block someBlock}b{/block} {/if} {/embed}
Output <span>b</span>
<span>b</span>
Note that I can't wrap {if} with {block} as I define multiple blocks so it would lead to repeating conditional logic in every block.
{if}
{block}
The text was updated successfully, but these errors were encountered:
This way the blocks do not work, see the documentation https://latte.nette.org/cs/template-inheritance#toc-layoutova-dedicnost:~:text=bez%20ohledu%20na%20to
Sorry, something went wrong.
@dg Why is this actually? Is it just "not implemented" or is it conceptually impossible – something like want to run TS code directly in browser?
It is conceptually impossible. It is something like
class Foo { if (3 === 4) { function someBlock() { return 'a' } } else { function someBlock() { return 'b' } } }
No branches or pull requests
Version: 2.9.2, 2.10.0
Bug Description
Parser throws:
Latte\CompileException: Cannot redeclare block 'someBlock' in ...
Steps To Reproduce
Run Latte with this code in a template file:
Expected Behavior
Output
<span>b</span>
Note that I can't wrap
{if}
with{block}
as I define multiple blocks so it would lead to repeating conditional logic in every block.The text was updated successfully, but these errors were encountered: