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
Cannot redeclare block when using condition in {embed} #253
Comments
dakur
changed the title
Cannot redeclare block when using condition in embed
Cannot redeclare block when using condition in {embed}
Jan 25, 2021
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 |
@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' }
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: