get() public method

模板变量获取
public get ( string $name = '' ) : mixed
$name string 变量名
return mixed
Example #1
0
 public function testVarGet()
 {
     $template = new Template();
     $data = ['a' => 'a', 'b' => 'b'];
     $template->assign($data);
     $this->assertEquals($data, $template->get());
 }
Example #2
0
 public function testVarAssign()
 {
     $template = new Template();
     $template->assign('name', 'value');
     $value = $template->get('name');
     $this->assertEquals('value', $value);
 }