Skip to content

Commit e687b75

Browse files
committed
handle nested templates
1 parent 629aa26 commit e687b75

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Tests/TemplateTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ public function testRender()
2121
$this->assertEquals("test a=1 b=2 c=3", Template::render('test{{for:v:k:counts}} {{k}}={{v}}{{endfor}}', ['counts' => ['a' => 1, 'b' => 2, 'c' => 3]]));
2222
$this->assertEquals("test (-1,-1) (-1,1) (1,-1) (1,1)", Template::render('test{{for:x:steps}}{{for:y:steps}} ({{x}},{{y}}){{endfor}}{{endfor}}', ['steps' => [-1, 1]]));
2323
$this->assertEquals("hello one two three", Template::render('hello{{for:i:counts}} {{if:i|eq(1)}}one{{elseif:i|eq(2)}}two{{else}}three{{endif}}{{endfor}}', ['counts' => [1, 2, 3]], ['eq' => function ($a, $b) {return $a == $b;}]));
24+
$this->assertEquals("hello <b>Maurits</b>", Template::render('hello {{content}}', ['content' => Template::render('<b>{{name}}</b>', ['name' => 'Maurits'])]));
2425
}
2526
}

0 commit comments

Comments
 (0)