Skip to content

Commit df1b07b

Browse files
committed
Temp test files
1 parent a847780 commit df1b07b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

test.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use DevTheorem\Handlebars\{Handlebars, Options};
4+
5+
require 'vendor/autoload.php';
6+
7+
$templateString = '{{> StrongPartial text="Use the syntax: {{varName}}."}}';
8+
9+
$template = Handlebars::compile($templateString, new Options(
10+
partials: [
11+
'StrongPartial' => '<strong>{{text}}</strong>',
12+
]
13+
));
14+
15+
echo $template([
16+
'varName' => 'Hello',
17+
]);

test2.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use DevTheorem\Handlebars\{Handlebars, HelperOptions, Options};
4+
5+
require 'vendor/autoload.php';
6+
7+
$templateString = '{{test "\"\"\"" prop="\"\"\""}}';
8+
9+
$template = Handlebars::compile($templateString, new Options(
10+
helpers: [
11+
'test' => function ($arg1, HelperOptions $options) {
12+
return "{$arg1} {$options->hash['prop']}";
13+
},
14+
]
15+
));
16+
17+
echo $template();

0 commit comments

Comments
 (0)