Skip to content

Commit

Permalink
Fixing bug: we can't "return" from the generated code
Browse files Browse the repository at this point in the history
This causes the entire template render / block to exit early.
  • Loading branch information
weaverryan committed Nov 6, 2023
1 parent dff45e9 commit 06f6b07
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/TwigComponent/src/Twig/ComponentNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ public function compile(Compiler $compiler): void
->indent()
->write('echo $preRendered;')
->raw("\n")
->write('return;')
->raw("\n")
->outdent()
->write('}')
->write('} else {')
->raw("\n")
->indent()
;

/*
Expand Down Expand Up @@ -162,6 +161,8 @@ public function compile(Compiler $compiler): void
;

$compiler
->outdent()
->write('}')
->raw("\n")
;
}
Expand Down

0 comments on commit 06f6b07

Please sign in to comment.