Skip to content

Commit 6c68d53

Browse files
committed
Temp todo
1 parent 2c55b09 commit 6c68d53

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

test.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
use DevTheorem\Handlebars\Handlebars;
4+
5+
require 'vendor/autoload.php';
6+
7+
$templateStr = <<<VAREND
8+
{{#each table as |value key|}}
9+
KEY: {{dump key}}
10+
VAL: {{dump value}}
11+
{{/each}}
12+
VAREND;
13+
14+
$helpers = [
15+
'dump' => fn($x) => var_export($x, true),
16+
];
17+
18+
$template = Handlebars::compile($templateStr);
19+
20+
$data = [
21+
'table' => ['foo' => 'bar'],
22+
];
23+
24+
echo $template($data, ['helpers' => $helpers]);

todo.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Double-check every LightnCandy issue where I left a comment, to see if any need
88
- [x] https://github.com/zordius/lightncandy/issues/346
99
- [x] https://github.com/zordius/lightncandy/issues/345
1010
- [x] https://github.com/zordius/lightncandy/issues/341
11+
- [x] https://github.com/zordius/lightncandy/issues/318
1112

1213

1314
Comment with fixed after release:
@@ -71,7 +72,9 @@ Output:
7172
7273

7374
- Support callable for helper functions: https://github.com/zordius/lightncandy/issues/228
75+
Comment with note about first-class callable syntax
7476

77+
- Include partial files: https://github.com/zordius/lightncandy/issues/312
7578

7679
[Unable to resolve partial when using sub-expression and partial resolver](https://github.com/devtheorem/php-handlebars/issues/5)
7780
- Maybe comment with approach using helper rather than partial?

0 commit comments

Comments
 (0)