Example #1
0
 public function testGetVar()
 {
     $provider = new ArrayProvider(['test.htpl' => '{var}']);
     $htpl = new Htpl($provider);
     $htpl->assignArray(['level1' => ['level2' => ['foo' => 'bar']]]);
     $htpl->assign('testFoo', 'testBar');
     $template = new Template($htpl, 'some template string');
     $this->assertSame('bar', $template->getVar('level1.level2.foo', $htpl->getVars()));
     $this->assertSame('testBar', $template->getVar('testFoo', $htpl->getVars()));
 }