예제 #1
0
 /**
  * Fetch rendered template
  *
  * @param  string $template Template pathname relative to templates directory
  * @param  array $data Associative array of template variables
  *
  * @return string
  */
 public function fetch($template, $data = [])
 {
     $data = array_merge($this->defaultVariables, $data);
     $this->smarty->assign($data);
     return $this->smarty->fetch($template);
 }
예제 #2
0
 public function testFetch()
 {
     $output = $this->view->fetch('hello.tpl', ['name' => 'Matheus']);
     $this->assertEquals("<p>Hello, my name is Matheus.</p>\n", $output);
 }
예제 #3
0
 public function testPlugin()
 {
     $output = $this->view->fetch('plugin.tpl');
     $this->assertEquals("<p>Plugin return: base_url_test.</p>\n", $output);
 }