This fixes the issue where variables created by @foreach() are not imported in to the scope of the Closure.
Specifically this is done by explicitly include the variables used in the alias expression of the @include directive.
That way things like ['amphibians' => $frogs + $toads, 'msg' => 'Welcome ' . $name] are correctly handled as well.
This also means that errors where an undefined variable is used will cause a single error at the place of @include rather then for ever usage in the included template.
Fixes #31
This fixes the issue where variables created by
@foreach()
are not imported in to the scope of theClosure
.Specifically this is done by explicitly include the variables used in the alias expression of the
@include
directive.That way things like
['amphibians' => $frogs + $toads, 'msg' => 'Welcome ' . $name]
are correctly handled as well.This also means that errors where an undefined variable is used will cause a single error at the place of
@include
rather then for ever usage in the included template.