File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ public function composePHPRender(string $code): string
9191 partials: isset( \$options['partials']) ? array_merge( \$partials, \$options['partials']) : \$partials,
9292 data: isset( \$options['data']) ? array_merge(['root' => \$in], \$options['data']) : ['root' => \$in],
9393 );
94+ \$in = & \$cx->data['root'];
9495 return ' $ code';
9596 };
9697 VAREND ;
Original file line number Diff line number Diff line change @@ -1545,6 +1545,24 @@ public static function issueProvider(): array
15451545 'expected ' => ' {{bar}} content ' ,
15461546 ],
15471547
1548+ [
1549+ 'id ' => 350 ,
1550+ 'template ' => <<<_hbs
1551+ Before: {{var}}
1552+ (Setting Variable) {{setvar "var" "Foo"}}
1553+ After: {{var}}
1554+ _hbs ,
1555+ 'data ' => ['var ' => 'value ' ],
1556+ 'options ' => new Options (
1557+ helpers: [
1558+ 'setvar ' => function ($ name , $ value , HelperOptions $ options ) {
1559+ $ options ->data ['root ' ][$ name ] = $ value ;
1560+ },
1561+ ],
1562+ ),
1563+ 'expected ' => "Before: value \n(Setting Variable) \nAfter: Foo " ,
1564+ ],
1565+
15481566 [
15491567 'id ' => 357 ,
15501568 'template ' => '{{echo (echo "foobar(moo).")}} ' ,
You can’t perform that action at this time.
0 commit comments